1
Fork 0

Got tmux to act the way I want on startup let's goooo

This commit is contained in:
Matei Adriel 2022-12-04 07:56:20 +01:00
parent 01ee066c62
commit 32b53a7fd6
21 changed files with 171 additions and 73 deletions

View file

@ -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_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_insert line # Set the insert mode cursor to a line
set fish_cursor_replace_one underscore # Set the replace mode cursor to an underscore set fish_cursor_replace_one underscore # Set the replace mode cursor to an underscore

View file

@ -46,6 +46,7 @@ local abbreviations = {
{ "ints", "\\mathbb{Z}" }, { "ints", "\\mathbb{Z}" },
{ "nats", "\\mathbb{N}" }, { "nats", "\\mathbb{N}" },
{ "rats", "\\mathbb{Q}" }, { "rats", "\\mathbb{Q}" },
{ "irats", "\\mathbb{I}" },
{ "rrea", "\\mathbb{R}" }, { "rrea", "\\mathbb{R}" },
{ "ppri", "\\mathbb{P}" }, { "ppri", "\\mathbb{P}" },
{ "ffie", "\\mathbb{F}" }, { "ffie", "\\mathbb{F}" },
@ -61,7 +62,7 @@ local abbreviations = {
{ "ett", "^{t}" }, { "ett", "^{t}" },
{ "tmat", "^{T}" }, -- Tranpose of a matrix { "tmat", "^{T}" }, -- Tranpose of a matrix
{ "cmat", "^{*}" }, -- Conjugate of a matrix { "cmat", "^{*}" }, -- Conjugate of a matrix
{"ortco", "^{\\bot}"}, -- Orthogonal complement { "ortco", "^{\\bot}" }, -- Orthogonal complement
{ "etp", "^{+}" }, -- Subscripts { "etp", "^{+}" }, -- Subscripts
{ "s0", "_{0}" }, { "s0", "_{0}" },
{ "s1", "_{1}" }, { "s1", "_{1}" },

View file

@ -8,7 +8,7 @@ function M.setup()
require("my.options").setup() require("my.options").setup()
require('my.keymaps').setup() require('my.keymaps').setup()
require('my.plugins').setup() require('my.plugins').setup()
require("telescope.extensions.unicode").setupAbbreviations() -- require("telescope.extensions.unicode").setupAbbreviations()
end end
return M return M

View file

@ -3,46 +3,46 @@ local helpers = require("my.helpers")
local M = {} local M = {}
function M.setup() function M.setup()
local opt = vim.opt -- to set options local opt = vim.opt -- to set options
-- Disable filetype.vim -- Disable filetype.vim
vim.g.do_filetype_lua = true vim.g.do_filetype_lua = true
vim.g.did_load_filetypes = false vim.g.did_load_filetypes = false
-- Basic options -- Basic options
opt.joinspaces = false -- No double spaces with join opt.joinspaces = false -- No double spaces with join
opt.list = true -- Show some invisible characters opt.list = true -- Show some invisible characters
opt.cmdheight = 0 -- Hide command line when it's not getting used opt.cmdheight = 0 -- Hide command line when it's not getting used
-- Line numbers -- Line numbers
opt.number = true -- Show line numbers opt.number = true -- Show line numbers
opt.relativenumber = true -- Relative line numbers opt.relativenumber = true -- Relative line numbers
-- TODO: only do this for specific filestypes -- TODO: only do this for specific filestypes
opt.expandtab = true -- Use spaces for the tab char opt.expandtab = true -- Use spaces for the tab char
opt.scrolloff = 4 -- Lines of context opt.scrolloff = 4 -- Lines of context
opt.shiftround = true -- Round indent opt.shiftround = true -- Round indent
opt.shiftwidth = 2 -- Size of an indent opt.shiftwidth = 2 -- Size of an indent
opt.termguicolors = true -- True color support opt.termguicolors = true -- True color support
opt.ignorecase = true -- Ignore case opt.ignorecase = true -- Ignore case
opt.smartcase = true -- Do not ignore case with capitals 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.splitbelow = true -- Put new windows below current
opt.splitright = true -- Put new windows right of current opt.splitright = true -- Put new windows right of current
opt.wrap = false -- Disable line wrap (by default) opt.wrap = false -- Disable line wrap (by default)
opt.wildmode = {'list', 'longest'} -- Command-line completion mode opt.wildmode = { 'list', 'longest' } -- Command-line completion mode
opt.completeopt = {"menu", "menuone", "noselect"} opt.completeopt = { "menu", "menuone", "noselect" }
-- Set leader -- Set leader
helpers.global("mapleader", " ") helpers.global("mapleader", " ")
-- Import other options -- Import other options
require("my.options.folding").setup() require("my.options.folding").setup()
end end
return M return M

View file

@ -38,7 +38,7 @@ function M.setup()
"saadparwaiz1/cmp_luasnip", -- snippet support for cmp "saadparwaiz1/cmp_luasnip", -- snippet support for cmp
"wakatime/vim-wakatime", -- track time usage "wakatime/vim-wakatime", -- track time usage
"vmchale/dhall-vim", -- dhall syntax highlighting "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 "psliwka/vim-smoothie", -- smooth scrolling
"easymotion/vim-easymotion", -- removes the need for spamming w or e "easymotion/vim-easymotion", -- removes the need for spamming w or e
"tpope/vim-surround", -- work with brackets, quotes, tags, etc "tpope/vim-surround", -- work with brackets, quotes, tags, etc

View file

@ -17,11 +17,11 @@ function M.setup()
require("my.plugins.nvim-tree").setup() require("my.plugins.nvim-tree").setup()
require("my.plugins.lualine").setup() require("my.plugins.lualine").setup()
require("my.plugins.vimux").setup() require("my.plugins.vimux").setup()
require("my.plugins.whichkey").setup() -- require("my.plugins.whichkey").setup()
require("toggleterm").setup() require("toggleterm").setup()
require("my.plugins.neogit").setup() require("my.plugins.neogit").setup()
require("my.plugins.noice").setup() -- require("my.plugins.noice").setup()
end) end)
require("my.plugins.dashboard").setup() require("my.plugins.dashboard").setup()
@ -32,7 +32,7 @@ function M.setup()
require("my.plugins.null-ls").setup() require("my.plugins.null-ls").setup()
require("my.plugins.vimtex").setup() require("my.plugins.vimtex").setup()
require("my.plugins.lean").setup() require("my.plugins.lean").setup()
require("my.plugins.notify").setup() -- require("my.plugins.notify").setup()
end) end)
if env.firevim.active() then if env.firevim.active() then

View file

@ -4,8 +4,8 @@ local M = {}
function M.setup() function M.setup()
require('lean').setup { require('lean').setup {
abbreviations = { builtin = true, cmp = true }, abbreviations = { builtin = true, cmp = true },
lsp = { on_attach = lspconfig.on_attach }, lsp = { on_attach = lspconfig.on_attach, capabilities = lspconfig.capabilities },
lsp3 = { on_attach = lspconfig.on_attach }, lsp3 = false,
mappings = true mappings = true
} }
end end

View file

@ -84,6 +84,7 @@ local servers = {
}, },
rnix = {}, rnix = {},
cssls = {}, cssls = {},
rust_analyzer = {},
-- texlab = { -- texlab = {
-- build = { -- build = {
-- executable = "tectonic", -- executable = "tectonic",
@ -101,8 +102,9 @@ local servers = {
-- agda = {}, Haven't gotten this one to work yet -- agda = {}, Haven't gotten this one to work yet
} }
M.capabilities = require('cmp_nvim_lsp').default_capabilities()
function M.setup() function M.setup()
local capabilities = require('cmp_nvim_lsp').default_capabilities()
-- Setup basic language servers -- Setup basic language servers
for lsp, details in pairs(servers) do 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+ debounce_text_changes = 150 -- This will be the default in neovim 0.7+
}, },
cmd = details.cmd, cmd = details.cmd,
capabilities = capabilities capabilities = M.capabilities
} }
end end
end end

View file

@ -1,18 +1,36 @@
local M = {} local M = {}
function M.setup() function M.setup()
require 'nvim-treesitter.configs'.setup { require'nvim-treesitter.configs'.setup {
ensure_installed = { ensure_installed = {
"bash", "javascript", "typescript", "c", "cpp", "css", "dockerfile", "bash",
"elixir", "fish", "html", "json", "latex", "python", "rust", "scss", "javascript",
"toml", "tsx", "vim", "yaml", "nix", "kotlin" "typescript",
"c",
"cpp",
"css",
"dockerfile",
"elixir",
"fish",
"html",
"json",
"latex",
"python",
"rust",
"scss",
"toml",
"tsx",
"vim",
"yaml",
"nix",
"kotlin"
}, },
sync_install = false, sync_install = false,
indent = { enable = true }, indent = { enable = true },
highlight = { highlight = {
enable = true, 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. -- 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). -- Set this to `true` if you depend on 'syntax' being enabled (like for indentation).

View file

@ -78,4 +78,5 @@ bind-key -T copy-mode-vi 'C-\' select-pane -l
# set-option -g @fastcopy-key a # set-option -g @fastcopy-key a
# Keep state around using resurrect # Keep state around using resurrect
set -g @resurrect-processes '"~python3"' # set -g @resurrect-processes '"~python3"'
# Restore on tmux start

View file

@ -12,7 +12,7 @@
"Absolute value": { "Absolute value": {
"prefix": "abs", "prefix": "abs",
"description": "Absolute values", "description": "Absolute values",
"body": "|$1|$0" "body": "\\abs{$1}$0"
}, },
"Lemma": { "Lemma": {
"prefix": "lemma", "prefix": "lemma",
@ -285,5 +285,16 @@
"prefix": "integral", "prefix": "integral",
"description": "Integral", "description": "Integral",
"body": "\\int $1 d${2:x}$0" "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"
]
} }
} }

View file

@ -287,11 +287,11 @@
] ]
}, },
"locked": { "locked": {
"lastModified": 1656169755, "lastModified": 1667907331,
"narHash": "sha256-Nlnm4jeQWEGjYrE6hxi/7HYHjBSZ/E0RtjCYifnNsWk=", "narHash": "sha256-bHkAwkYlBjkupPUFcQjimNS8gxWSWjOTevEuwdnp5m0=",
"owner": "nix-community", "owner": "nix-community",
"repo": "home-manager", "repo": "home-manager",
"rev": "4a3d01fb53f52ac83194081272795aa4612c2381", "rev": "6639e3a837fc5deb6f99554072789724997bc8e5",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -567,11 +567,11 @@
}, },
"nixos-unstable": { "nixos-unstable": {
"locked": { "locked": {
"lastModified": 1660646295, "lastModified": 1669791787,
"narHash": "sha256-V4G+egGRc3elXPTr7QLJ7r7yrYed0areIKDiIAlMLC8=", "narHash": "sha256-KBfoA2fOI5+wCrm7PR+j7jHqXeTkVRPQ0m5fcKchyuU=",
"owner": "nixos", "owner": "nixos",
"repo": "nixpkgs", "repo": "nixpkgs",
"rev": "762b003329510ea855b4097a37511eb19c7077f0", "rev": "e76c78d20685a043d23f5f9e0ccd2203997f1fb1",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -583,11 +583,11 @@
}, },
"nixpkgs": { "nixpkgs": {
"locked": { "locked": {
"lastModified": 1660749083, "lastModified": 1669861251,
"narHash": "sha256-GHLFMGH+r3OmI4tV0x/RtxN7DkHcH2ZOhK8uzQeSLiY=", "narHash": "sha256-QyBI5QNT/nQRkCsZHnN3ImKCaxrtMArVqNioA7diwU4=",
"owner": "nixos", "owner": "nixos",
"repo": "nixpkgs", "repo": "nixpkgs",
"rev": "a55a7db823959cf509d55325201f1864af4574b9", "rev": "af4d0d532f413ad2fbb3a13f47c98c9fca1948e1",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -599,11 +599,11 @@
}, },
"nixpkgs-unstable": { "nixpkgs-unstable": {
"locked": { "locked": {
"lastModified": 1660639432, "lastModified": 1669867399,
"narHash": "sha256-2WDiboOCfB0LhvnDVMXOAr8ZLDfm3WdO54CkoDPwN1A=", "narHash": "sha256-Z8RXSFYOsIsTG96ROKtV0eZ8Q7u4irFWm6ELqfw7mT8=",
"owner": "nixos", "owner": "nixos",
"repo": "nixpkgs", "repo": "nixpkgs",
"rev": "6c6409e965a6c883677be7b9d87a95fab6c3472e", "rev": "38e591dd05ffc8bdf79dc752ba78b05e370416fa",
"type": "github" "type": "github"
}, },
"original": { "original": {

View file

@ -5,15 +5,30 @@ let
fastcopy = pkgs.tmuxPlugins.mkTmuxPlugin fastcopy = pkgs.tmuxPlugins.mkTmuxPlugin
{ {
pluginName = "fastcopy"; pluginName = "fastcopy";
version = "unstable-2022-04-18"; version = "unstable-2022-11-16";
src = pkgs.fetchFromGitHub src = pkgs.fetchFromGitHub
{ {
owner = "abhinav"; owner = "abhinav";
repo = "tmux-fastcopy"; repo = "tmux-fastcopy";
sha256 = "0d2xdch5w35mw3kpw1y6jy8wk4zj43pjx73jlx83ciqddl3975x6"; sha256 = "1ald4ycgwj1fhk82yvsy951kgnn5im53fhsscz20hvjsqql7j4j3";
rev = "4b9bc8e9e71c5b6eeb44a02f608baec07e12ea3d"; 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 in
{ {
home-manager.users.adrielus.programs = { home-manager.users.adrielus.programs = {
@ -33,6 +48,15 @@ in
sessionist # Nicer workflow for switching around between session sessionist # Nicer workflow for switching around between session
# fastcopy # Easy copying of stuff # fastcopy # Easy copying of stuff
resurrect # Save / restore tmux sessions 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 = '' extraConfig = ''
@ -45,3 +69,4 @@ in
}; };
}; };
} }

View file

@ -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
'';
}

View file

@ -1,6 +1,6 @@
{-# LANGUAGE BlockArguments #-} {-# LANGUAGE BlockArguments #-}
import Control.Monad (join) import Control.Monad (forM_, join)
import Data.Function ((&)) import Data.Function ((&))
import System.Environment import System.Environment
import System.Process import System.Process
@ -29,7 +29,7 @@ main =
{ modMask = mod4Mask, { modMask = mod4Mask,
layoutHook = myLayoutHook, layoutHook = myLayoutHook,
startupHook = startup, startupHook = startup,
manageHook = manageDocks <+> myManagerHook <+> manageHook kdeConfig, manageHook = manageDocks <+> manageSpawn <+> myManagerHook <+> manageHook kdeConfig,
handleEventHook = handleEventHook kdeConfig <+> fullscreenEventHook, handleEventHook = handleEventHook kdeConfig <+> fullscreenEventHook,
terminal = myTerminal, terminal = myTerminal,
workspaces = myWorkspaces, workspaces = myWorkspaces,
@ -104,5 +104,13 @@ main =
layouts = tall ||| threeCols ||| Full layouts = tall ||| threeCols ||| Full
myLayoutHook = desktopLayoutModifiers $ spacingHook layouts myLayoutHook = desktopLayoutModifiers $ spacingHook layouts
startupApps =
[ (0, "alacritty"),
(1, "google-chrome-stable"),
(2, "Discord")
]
startup :: X () startup :: X ()
startup = pure () startup = do
forM_ startupApps \(index, app) -> do
spawnOn (myWorkspaces !! index) app

View file

@ -1,10 +1,10 @@
{ pkgs, ... }: { { pkgs, ... }: {
home-manager.users.adrielus = { home-manager.users.adrielus = {
xsession.windowManager.xmonad = { # xsession.windowManager.xmonad = {
enable = true; # enable = true;
enableContribAndExtras = true; # enableContribAndExtras = true;
config = ./Main.hs; # config = ./Main.hs;
}; # };
home.packages = with pkgs; [ xwallpaper ]; home.packages = with pkgs; [ xwallpaper ];

View file

@ -1,5 +1,5 @@
{ pkgs, ... }: { { pkgs, ... }: {
home-manager.users.adrielus.home.packages = with pkgs; [ home-manager.users.adrielus.home.packages = with pkgs; [
elan # lean version manager unstable.elan # lean version manager
]; ];
} }

View file

@ -1,3 +1,3 @@
{ pkgs, ... }: { { pkgs, ... }: {
home-manager.users.adrielus.home.packages = with pkgs; [ rustup ]; home-manager.users.adrielus.home.packages = with pkgs; [ rustup rust-analyzer ];
} }

View file

@ -25,7 +25,8 @@ lib.lists.map (theme: pkgs.callPackage theme { }) [
# wallpaper = "landscapes/salty_mountains.png"; # wallpaper = "landscapes/salty_mountains.png";
# wallpaper = "misc/rainbow.png"; # wallpaper = "misc/rainbow.png";
# wallpaper.foreign = ./wallpapers/eye.png; # wallpaper.foreign = ./wallpapers/eye.png;
wallpaper.foreign = ./wallpapers/mountain.png; # wallpaper.foreign = ./wallpapers/mountain.png;
wallpaper.foreign = ./wallpapers/rw_tower.png;
transparency = 1; transparency = 1;
variant = "latte"; variant = "latte";
}) })

Binary file not shown.

After

Width:  |  Height:  |  Size: 662 KiB

View file

@ -35,7 +35,11 @@ in
# Enable xmonad # Enable xmonad
windowManager.xmonad.enable = true; windowManager.xmonad = {
enable = true;
enableContribAndExtras = true;
config = ./applications/xmonad/Main.hs;
};
libinput = { libinput = {
# Enable touchpad support. # Enable touchpad support.