diff --git a/dotfiles/fish/config.fish b/dotfiles/fish/config.fish index 0b39554..e343993 100644 --- a/dotfiles/fish/config.fish +++ b/dotfiles/fish/config.fish @@ -1,3 +1,8 @@ +if status is-interactive +and not set -q TMUX + exec tmux attach -t Welcome || tmux +end + set fish_cursor_default block # Set the normal and visual mode cursors to a block set fish_cursor_insert line # Set the insert mode cursor to a line set fish_cursor_replace_one underscore # Set the replace mode cursor to an underscore diff --git a/dotfiles/neovim/ftplugin/tex.lua b/dotfiles/neovim/ftplugin/tex.lua index 553d4e7..e03b941 100644 --- a/dotfiles/neovim/ftplugin/tex.lua +++ b/dotfiles/neovim/ftplugin/tex.lua @@ -46,6 +46,7 @@ local abbreviations = { { "ints", "\\mathbb{Z}" }, { "nats", "\\mathbb{N}" }, { "rats", "\\mathbb{Q}" }, + { "irats", "\\mathbb{I}" }, { "rrea", "\\mathbb{R}" }, { "ppri", "\\mathbb{P}" }, { "ffie", "\\mathbb{F}" }, @@ -61,7 +62,7 @@ local abbreviations = { { "ett", "^{t}" }, { "tmat", "^{T}" }, -- Tranpose of a matrix { "cmat", "^{*}" }, -- Conjugate of a matrix - {"ortco", "^{\\bot}"}, -- Orthogonal complement + { "ortco", "^{\\bot}" }, -- Orthogonal complement { "etp", "^{+}" }, -- Subscripts { "s0", "_{0}" }, { "s1", "_{1}" }, diff --git a/dotfiles/neovim/lua/my/init.lua b/dotfiles/neovim/lua/my/init.lua index bb1cd33..039c3d0 100644 --- a/dotfiles/neovim/lua/my/init.lua +++ b/dotfiles/neovim/lua/my/init.lua @@ -8,7 +8,7 @@ function M.setup() require("my.options").setup() require('my.keymaps').setup() require('my.plugins').setup() - require("telescope.extensions.unicode").setupAbbreviations() + -- require("telescope.extensions.unicode").setupAbbreviations() end return M diff --git a/dotfiles/neovim/lua/my/options.lua b/dotfiles/neovim/lua/my/options.lua index c081084..5002b34 100644 --- a/dotfiles/neovim/lua/my/options.lua +++ b/dotfiles/neovim/lua/my/options.lua @@ -3,46 +3,46 @@ local helpers = require("my.helpers") local M = {} function M.setup() - local opt = vim.opt -- to set options + local opt = vim.opt -- to set options - -- Disable filetype.vim - vim.g.do_filetype_lua = true - vim.g.did_load_filetypes = false + -- Disable filetype.vim + vim.g.do_filetype_lua = true + vim.g.did_load_filetypes = false - -- Basic options - opt.joinspaces = false -- No double spaces with join - opt.list = true -- Show some invisible characters - opt.cmdheight = 0 -- Hide command line when it's not getting used + -- Basic options + opt.joinspaces = false -- No double spaces with join + opt.list = true -- Show some invisible characters + opt.cmdheight = 0 -- Hide command line when it's not getting used - -- Line numbers - opt.number = true -- Show line numbers - opt.relativenumber = true -- Relative line numbers + -- Line numbers + opt.number = true -- Show line numbers + opt.relativenumber = true -- Relative line numbers - -- TODO: only do this for specific filestypes - opt.expandtab = true -- Use spaces for the tab char + -- TODO: only do this for specific filestypes + opt.expandtab = true -- Use spaces for the tab char - opt.scrolloff = 4 -- Lines of context - opt.shiftround = true -- Round indent - opt.shiftwidth = 2 -- Size of an indent - opt.termguicolors = true -- True color support + opt.scrolloff = 4 -- Lines of context + opt.shiftround = true -- Round indent + opt.shiftwidth = 2 -- Size of an indent + opt.termguicolors = true -- True color support - opt.ignorecase = true -- Ignore case - opt.smartcase = true -- Do not ignore case with capitals + opt.ignorecase = true -- Ignore case + opt.smartcase = true -- Do not ignore case with capitals - opt.smartindent = true -- Insert indents automatically + opt.smartindent = true -- Insert indents automatically - opt.splitbelow = true -- Put new windows below current - opt.splitright = true -- Put new windows right of current + opt.splitbelow = true -- Put new windows below current + opt.splitright = true -- Put new windows right of current - opt.wrap = false -- Disable line wrap (by default) - opt.wildmode = {'list', 'longest'} -- Command-line completion mode - opt.completeopt = {"menu", "menuone", "noselect"} + opt.wrap = false -- Disable line wrap (by default) + opt.wildmode = { 'list', 'longest' } -- Command-line completion mode + opt.completeopt = { "menu", "menuone", "noselect" } - -- Set leader - helpers.global("mapleader", " ") + -- Set leader + helpers.global("mapleader", " ") - -- Import other options - require("my.options.folding").setup() + -- Import other options + require("my.options.folding").setup() end return M diff --git a/dotfiles/neovim/lua/my/paq.lua b/dotfiles/neovim/lua/my/paq.lua index 9b6548e..645aab2 100644 --- a/dotfiles/neovim/lua/my/paq.lua +++ b/dotfiles/neovim/lua/my/paq.lua @@ -38,7 +38,7 @@ function M.setup() "saadparwaiz1/cmp_luasnip", -- snippet support for cmp "wakatime/vim-wakatime", -- track time usage "vmchale/dhall-vim", -- dhall syntax highlighting - "folke/which-key.nvim", -- shows what other keys I can press to finish a command + -- "folke/which-key.nvim", -- shows what other keys I can press to finish a command "psliwka/vim-smoothie", -- smooth scrolling "easymotion/vim-easymotion", -- removes the need for spamming w or e "tpope/vim-surround", -- work with brackets, quotes, tags, etc diff --git a/dotfiles/neovim/lua/my/plugins/init.lua b/dotfiles/neovim/lua/my/plugins/init.lua index ad90186..7ad750c 100644 --- a/dotfiles/neovim/lua/my/plugins/init.lua +++ b/dotfiles/neovim/lua/my/plugins/init.lua @@ -17,11 +17,11 @@ function M.setup() require("my.plugins.nvim-tree").setup() require("my.plugins.lualine").setup() require("my.plugins.vimux").setup() - require("my.plugins.whichkey").setup() + -- require("my.plugins.whichkey").setup() require("toggleterm").setup() require("my.plugins.neogit").setup() - require("my.plugins.noice").setup() + -- require("my.plugins.noice").setup() end) require("my.plugins.dashboard").setup() @@ -32,7 +32,7 @@ function M.setup() require("my.plugins.null-ls").setup() require("my.plugins.vimtex").setup() require("my.plugins.lean").setup() - require("my.plugins.notify").setup() + -- require("my.plugins.notify").setup() end) if env.firevim.active() then diff --git a/dotfiles/neovim/lua/my/plugins/lean.lua b/dotfiles/neovim/lua/my/plugins/lean.lua index 77fb679..4e631e2 100644 --- a/dotfiles/neovim/lua/my/plugins/lean.lua +++ b/dotfiles/neovim/lua/my/plugins/lean.lua @@ -4,8 +4,8 @@ local M = {} function M.setup() require('lean').setup { abbreviations = { builtin = true, cmp = true }, - lsp = { on_attach = lspconfig.on_attach }, - lsp3 = { on_attach = lspconfig.on_attach }, + lsp = { on_attach = lspconfig.on_attach, capabilities = lspconfig.capabilities }, + lsp3 = false, mappings = true } end diff --git a/dotfiles/neovim/lua/my/plugins/lspconfig.lua b/dotfiles/neovim/lua/my/plugins/lspconfig.lua index e0a7a28..4a218fe 100644 --- a/dotfiles/neovim/lua/my/plugins/lspconfig.lua +++ b/dotfiles/neovim/lua/my/plugins/lspconfig.lua @@ -84,6 +84,7 @@ local servers = { }, rnix = {}, cssls = {}, + rust_analyzer = {}, -- texlab = { -- build = { -- executable = "tectonic", @@ -101,8 +102,9 @@ local servers = { -- agda = {}, Haven't gotten this one to work yet } +M.capabilities = require('cmp_nvim_lsp').default_capabilities() + function M.setup() - local capabilities = require('cmp_nvim_lsp').default_capabilities() -- Setup basic language servers for lsp, details in pairs(servers) do @@ -118,7 +120,7 @@ function M.setup() debounce_text_changes = 150 -- This will be the default in neovim 0.7+ }, cmd = details.cmd, - capabilities = capabilities + capabilities = M.capabilities } end end diff --git a/dotfiles/neovim/lua/my/plugins/treesitter.lua b/dotfiles/neovim/lua/my/plugins/treesitter.lua index 9d3445e..51a048e 100644 --- a/dotfiles/neovim/lua/my/plugins/treesitter.lua +++ b/dotfiles/neovim/lua/my/plugins/treesitter.lua @@ -1,18 +1,36 @@ local M = {} function M.setup() - require 'nvim-treesitter.configs'.setup { + require'nvim-treesitter.configs'.setup { ensure_installed = { - "bash", "javascript", "typescript", "c", "cpp", "css", "dockerfile", - "elixir", "fish", "html", "json", "latex", "python", "rust", "scss", - "toml", "tsx", "vim", "yaml", "nix", "kotlin" + "bash", + "javascript", + "typescript", + "c", + "cpp", + "css", + "dockerfile", + "elixir", + "fish", + "html", + "json", + "latex", + "python", + "rust", + "scss", + "toml", + "tsx", + "vim", + "yaml", + "nix", + "kotlin" }, sync_install = false, indent = { enable = true }, highlight = { enable = true, - disable = { "kotlin", "tex", "latex" }, + disable = { "kotlin", "tex", "latex", "lean" }, -- Setting this to true will run `:h syntax` and tree-sitter at the same time. -- Set this to `true` if you depend on 'syntax' being enabled (like for indentation). diff --git a/dotfiles/tmux/tmux.conf b/dotfiles/tmux/tmux.conf index b938902..2516c4b 100644 --- a/dotfiles/tmux/tmux.conf +++ b/dotfiles/tmux/tmux.conf @@ -78,4 +78,5 @@ bind-key -T copy-mode-vi 'C-\' select-pane -l # set-option -g @fastcopy-key a # Keep state around using resurrect -set -g @resurrect-processes '"~python3"' +# set -g @resurrect-processes '"~python3"' +# Restore on tmux start diff --git a/dotfiles/vscode-snippets/snippets/latex/core.json b/dotfiles/vscode-snippets/snippets/latex/core.json index f7d7a1d..07d494c 100644 --- a/dotfiles/vscode-snippets/snippets/latex/core.json +++ b/dotfiles/vscode-snippets/snippets/latex/core.json @@ -12,7 +12,7 @@ "Absolute value": { "prefix": "abs", "description": "Absolute values", - "body": "|$1|$0" + "body": "\\abs{$1}$0" }, "Lemma": { "prefix": "lemma", @@ -285,5 +285,16 @@ "prefix": "integral", "description": "Integral", "body": "\\int $1 d${2:x}$0" + }, + "Iff cases": { + "prefix": "ciff", + "description": "Prove an equivalence in both directions", + "body": [ + "\\begin{enumerate}", + "\t\\item[$\\implies$]$1", + "\t\\item[$\\impliedby$]$2", + "\\end{enumerate}", + "$0" + ] } } diff --git a/flake.lock b/flake.lock index 0807046..a06a8e5 100644 --- a/flake.lock +++ b/flake.lock @@ -287,11 +287,11 @@ ] }, "locked": { - "lastModified": 1656169755, - "narHash": "sha256-Nlnm4jeQWEGjYrE6hxi/7HYHjBSZ/E0RtjCYifnNsWk=", + "lastModified": 1667907331, + "narHash": "sha256-bHkAwkYlBjkupPUFcQjimNS8gxWSWjOTevEuwdnp5m0=", "owner": "nix-community", "repo": "home-manager", - "rev": "4a3d01fb53f52ac83194081272795aa4612c2381", + "rev": "6639e3a837fc5deb6f99554072789724997bc8e5", "type": "github" }, "original": { @@ -567,11 +567,11 @@ }, "nixos-unstable": { "locked": { - "lastModified": 1660646295, - "narHash": "sha256-V4G+egGRc3elXPTr7QLJ7r7yrYed0areIKDiIAlMLC8=", + "lastModified": 1669791787, + "narHash": "sha256-KBfoA2fOI5+wCrm7PR+j7jHqXeTkVRPQ0m5fcKchyuU=", "owner": "nixos", "repo": "nixpkgs", - "rev": "762b003329510ea855b4097a37511eb19c7077f0", + "rev": "e76c78d20685a043d23f5f9e0ccd2203997f1fb1", "type": "github" }, "original": { @@ -583,11 +583,11 @@ }, "nixpkgs": { "locked": { - "lastModified": 1660749083, - "narHash": "sha256-GHLFMGH+r3OmI4tV0x/RtxN7DkHcH2ZOhK8uzQeSLiY=", + "lastModified": 1669861251, + "narHash": "sha256-QyBI5QNT/nQRkCsZHnN3ImKCaxrtMArVqNioA7diwU4=", "owner": "nixos", "repo": "nixpkgs", - "rev": "a55a7db823959cf509d55325201f1864af4574b9", + "rev": "af4d0d532f413ad2fbb3a13f47c98c9fca1948e1", "type": "github" }, "original": { @@ -599,11 +599,11 @@ }, "nixpkgs-unstable": { "locked": { - "lastModified": 1660639432, - "narHash": "sha256-2WDiboOCfB0LhvnDVMXOAr8ZLDfm3WdO54CkoDPwN1A=", + "lastModified": 1669867399, + "narHash": "sha256-Z8RXSFYOsIsTG96ROKtV0eZ8Q7u4irFWm6ELqfw7mT8=", "owner": "nixos", "repo": "nixpkgs", - "rev": "6c6409e965a6c883677be7b9d87a95fab6c3472e", + "rev": "38e591dd05ffc8bdf79dc752ba78b05e370416fa", "type": "github" }, "original": { diff --git a/modules/applications/tmux.nix b/modules/applications/tmux.nix index 0eea7da..5fec315 100644 --- a/modules/applications/tmux.nix +++ b/modules/applications/tmux.nix @@ -5,15 +5,30 @@ let fastcopy = pkgs.tmuxPlugins.mkTmuxPlugin { pluginName = "fastcopy"; - version = "unstable-2022-04-18"; + version = "unstable-2022-11-16"; src = pkgs.fetchFromGitHub { owner = "abhinav"; repo = "tmux-fastcopy"; - sha256 = "0d2xdch5w35mw3kpw1y6jy8wk4zj43pjx73jlx83ciqddl3975x6"; - rev = "4b9bc8e9e71c5b6eeb44a02f608baec07e12ea3d"; + sha256 = "1ald4ycgwj1fhk82yvsy951kgnn5im53fhsscz20hvjsqql7j4j3"; + rev = "41f4c1c9fae7eb05c85ee2e248719f004dcfc90e"; }; }; + + cowboy = pkgs.tmuxPlugins.mkTmuxPlugin + { + pluginName = "cowboy"; + version = "unstable-2021-05-11"; + src = pkgs.fetchFromGitHub + { + owner = "tmux-plugins"; + repo = "tmux-cowboy"; + sha256 = "16wqwfaqy7nhiy1ijkng1x4baqq7s9if0m3ffcrnakza69s6r4r8"; + rev = "75702b6d0a866769dd14f3896e9d19f7e0acd4f2"; + }; + }; + + muxile = pkgs.callPackage ./tmux/muxile.nix { }; in { home-manager.users.adrielus.programs = { @@ -33,6 +48,15 @@ in sessionist # Nicer workflow for switching around between session # fastcopy # Easy copying of stuff resurrect # Save / restore tmux sessions + # muxile # Track tmux sessions on my phone + # cowboy # kill all hanging processes inside pane + { + plugin = continuum; # start tmux on boot & more + extraConfig = '' + set -g @continuum-restore 'on' + set -g @continuum-boot 'on' + ''; + } ]; extraConfig = '' @@ -45,3 +69,4 @@ in }; }; } + diff --git a/modules/applications/tmux/muxile.nix b/modules/applications/tmux/muxile.nix new file mode 100644 index 0000000..8205fac --- /dev/null +++ b/modules/applications/tmux/muxile.nix @@ -0,0 +1,22 @@ +{ pkgs, ... }: +let dependencies = [ pkgs.qrencode pkgs.jq pkgs.websocat ]; +in +pkgs.tmuxPlugins.mkTmuxPlugin +{ + pluginName = "muxile"; + version = "unstable-2021-08-08"; + src = pkgs.fetchFromGitHub + { + owner = "bjesus"; + repo = "muxile"; + sha256 = "12kmcyizzglr4r7nisjbjmwmw1g4hbwpkil53zzmq9wx60l8lwgb"; + rev = "7310995ed1827844a528a32bb2d3a3694f1c4a0d"; + }; + nativeBuildInputs = [ pkgs.makeWrapper ]; + postInstall = '' + for f in $target/scripts/*.sh; do + wrapProgram $f \ + --prefix PATH : ${lib.makeBinPath dependencies} + done + ''; +} diff --git a/modules/applications/xmonad/Main.hs b/modules/applications/xmonad/Main.hs index ba1768b..aebe12e 100644 --- a/modules/applications/xmonad/Main.hs +++ b/modules/applications/xmonad/Main.hs @@ -1,6 +1,6 @@ {-# LANGUAGE BlockArguments #-} -import Control.Monad (join) +import Control.Monad (forM_, join) import Data.Function ((&)) import System.Environment import System.Process @@ -29,7 +29,7 @@ main = { modMask = mod4Mask, layoutHook = myLayoutHook, startupHook = startup, - manageHook = manageDocks <+> myManagerHook <+> manageHook kdeConfig, + manageHook = manageDocks <+> manageSpawn <+> myManagerHook <+> manageHook kdeConfig, handleEventHook = handleEventHook kdeConfig <+> fullscreenEventHook, terminal = myTerminal, workspaces = myWorkspaces, @@ -104,5 +104,13 @@ main = layouts = tall ||| threeCols ||| Full myLayoutHook = desktopLayoutModifiers $ spacingHook layouts + startupApps = + [ (0, "alacritty"), + (1, "google-chrome-stable"), + (2, "Discord") + ] + startup :: X () - startup = pure () + startup = do + forM_ startupApps \(index, app) -> do + spawnOn (myWorkspaces !! index) app diff --git a/modules/applications/xmonad/default.nix b/modules/applications/xmonad/default.nix index e63fbce..220fd7c 100644 --- a/modules/applications/xmonad/default.nix +++ b/modules/applications/xmonad/default.nix @@ -1,10 +1,10 @@ { pkgs, ... }: { home-manager.users.adrielus = { - xsession.windowManager.xmonad = { - enable = true; - enableContribAndExtras = true; - config = ./Main.hs; - }; + # xsession.windowManager.xmonad = { + # enable = true; + # enableContribAndExtras = true; + # config = ./Main.hs; + # }; home.packages = with pkgs; [ xwallpaper ]; diff --git a/modules/dev/lean.nix b/modules/dev/lean.nix index 84d6fd8..840df2f 100644 --- a/modules/dev/lean.nix +++ b/modules/dev/lean.nix @@ -1,5 +1,5 @@ { pkgs, ... }: { home-manager.users.adrielus.home.packages = with pkgs; [ - elan # lean version manager + unstable.elan # lean version manager ]; } diff --git a/modules/dev/rust.nix b/modules/dev/rust.nix index f3b86ec..95ea437 100644 --- a/modules/dev/rust.nix +++ b/modules/dev/rust.nix @@ -1,3 +1,3 @@ { pkgs, ... }: { - home-manager.users.adrielus.home.packages = with pkgs; [ rustup ]; + home-manager.users.adrielus.home.packages = with pkgs; [ rustup rust-analyzer ]; } diff --git a/modules/themes/themes.nix b/modules/themes/themes.nix index a318ec0..096556a 100644 --- a/modules/themes/themes.nix +++ b/modules/themes/themes.nix @@ -25,7 +25,8 @@ lib.lists.map (theme: pkgs.callPackage theme { }) [ # wallpaper = "landscapes/salty_mountains.png"; # wallpaper = "misc/rainbow.png"; # wallpaper.foreign = ./wallpapers/eye.png; - wallpaper.foreign = ./wallpapers/mountain.png; + # wallpaper.foreign = ./wallpapers/mountain.png; + wallpaper.foreign = ./wallpapers/rw_tower.png; transparency = 1; variant = "latte"; }) diff --git a/modules/themes/wallpapers/rw_tower.png b/modules/themes/wallpapers/rw_tower.png new file mode 100644 index 0000000..6adae64 Binary files /dev/null and b/modules/themes/wallpapers/rw_tower.png differ diff --git a/modules/xserver.nix b/modules/xserver.nix index 94e9877..e45cd31 100644 --- a/modules/xserver.nix +++ b/modules/xserver.nix @@ -35,7 +35,11 @@ in # Enable xmonad - windowManager.xmonad.enable = true; + windowManager.xmonad = { + enable = true; + enableContribAndExtras = true; + config = ./applications/xmonad/Main.hs; + }; libinput = { # Enable touchpad support.