1
Fork 0
This commit is contained in:
Matei Adriel 2022-12-09 02:32:25 +01:00
parent 811660e30a
commit 01e4fe7095
22 changed files with 102 additions and 122 deletions

View file

@ -68,6 +68,7 @@ in
sound.enable = true; sound.enable = true;
system.stateVersion = "19.03"; system.stateVersion = "19.03";
home-manager.users.adrielus.home.stateVersion = "19.03";
# TODO: put nixpkgs stuff inside their own file # TODO: put nixpkgs stuff inside their own file
nixpkgs.config.allowUnfree = true; nixpkgs.config.allowUnfree = true;

View file

@ -1,6 +1,6 @@
if status is-interactive if status is-interactive
and not set -q TMUX and not set -q TMUX
exec tmux attach -t Welcome || tmux exec tmux attach -t Welcome || tmux || echo "Something went wrong trying to start tmux"
end 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

View file

@ -83,14 +83,10 @@ local abbreviations = {
{ "dhx", "h'(x)" }, -- Basic commands { "dhx", "h'(x)" }, -- Basic commands
{ "mangle", "\\measuredangle" }, { "mangle", "\\measuredangle" },
{ "aangle", "\\angle" }, { "aangle", "\\angle" },
{ "creq", "\\\\&=" },
{ "aeq", "&=" },
{ "leq", "\\leq" },
{ "geq", "\\geq" },
{ "sdiff", "\\setminus" }, { "sdiff", "\\setminus" },
{ "sst", "\\subset" }, { "sst", "\\subset" },
{ "sseq", "\\subseteq" }, { "sseq", "\\subseteq" },
{ "neq", "\\neq" },
{ "nin", "\\not\\in" }, { "nin", "\\not\\in" },
{ "iin", "\\in" }, { "iin", "\\in" },
{ "tto", "\\to" }, { "tto", "\\to" },
@ -135,7 +131,15 @@ local abolishAbbreviations = {
{ "dete{,s}", "determinant{}" }, { "dete{,s}", "determinant{}" },
{ "bcla", "by contradiction let's assume" }, { "bcla", "by contradiction let's assume" },
{ "ort{n,g}", "orto{normal,gonal}" }, { "ort{n,g}", "orto{normal,gonal}" },
{ "l{in,de}", "linearly {independent,dependent}" } { "l{in,de}", "linearly {independent,dependent}" },
{ "wlg", "without loss of generality" },
-- My own operator syntax:
-- - Any operator can be prefixed with "a" to
-- align in aligned mode
-- - Any operator can be prefixed with cr to
-- start a new line and align in aligned mode
{ "{cr,a,}{eq,neq,leq,geq,lt,gt}", "{\\\\\\&,&,}{=,\\neq,\\leq,\\geq,<,>}" }
} }
A.manyLocalAbbr(abbreviations) A.manyLocalAbbr(abbreviations)

View file

@ -0,0 +1,4 @@
{
"$schema": "https://raw.githubusercontent.com/sumneko/vscode-lua/master/setting/schema.json",
"Lua.workspace.checkThirdParty": false
}

View file

@ -1,14 +1,14 @@
local M = {} local M = {}
local function swap(key) local function swap(key)
vim.keymap.set("n", key, "g" .. key, { buffer = true }) vim.keymap.set("nv", key, "g" .. key, { buffer = true })
vim.keymap.set("n", "g" .. key, key, { buffer = true }) vim.keymap.set("nv", "g" .. key, key, { buffer = true })
end end
-- Same as swap, but the key is aprt of an arpeggio chord -- Same as swap, but the key is aprt of an arpeggio chord
local function swapArpeggio(key) local function swapArpeggio(key)
vim.keymap.set("n", "<Plug>(arpeggio-default:" .. key .. ")", "g" .. key, { buffer = true }) vim.keymap.set("nv", "<Plug>(arpeggio-default:" .. key .. ")", "g" .. key, { buffer = true })
vim.keymap.set("n", "g" .. key, key, { buffer = true }) vim.keymap.set("nv", "g" .. key, key, { buffer = true })
end end
function M.setup() function M.setup()

View file

@ -34,25 +34,27 @@ function M.delimitedTextobject(from, to, name, perhapsOpts)
end end
function M.setup() function M.setup()
-- I rarely use macro stuff
M.move("q", "yq", { desc = "Record macro" }) M.move("q", "yq", { desc = "Record macro" })
M.move("Q", "yQ") M.move("Q", "yQ")
-- Free these up for easymotion-style plugins
-- vim.keymap.set("n", "s", "<Nop>")
-- vim.keymap.set("n", "S", "<Nop>")
M.move("<C-^>", "<Leader>a", { desc = "Go to previous file" }) M.move("<C-^>", "<Leader>a", { desc = "Go to previous file" })
vim.keymap.set({ "n", "v" }, "qn", function() vim.keymap.set({ "n", "v" }, "<leader>q", function()
local buf = vim.api.nvim_win_get_buf(0) local buf = vim.api.nvim_win_get_buf(0)
-- Only save if file is writable -- Only save if file is writable
if vim.bo[buf].modifiable and not vim.bo[buf].readonly then if vim.bo[buf].modifiable and not vim.bo[buf].readonly then vim.cmd [[write]] end
vim.cmd [[write]]
end
vim.cmd "q" vim.cmd "q"
end, { desc = "Quit current buffer" }) end, { desc = "Quit current buffer" })
vim.keymap.set("n", "Q", ":wqa<cr>", { desc = "Save all files and quit" }) vim.keymap.set("n", "Q", ":wqa<cr>", { desc = "Save all files and quit" })
vim.keymap.set("n", "<leader>rw", ":%s/<C-r><C-w>/", { vim.keymap.set("n", "<leader>rw", ":%s/<C-r><C-w>/", { desc = "Replace word in file" })
desc = "Replace word in file"
})
M.delimitedTextobject("q", '"', "quotes") M.delimitedTextobject("q", '"', "quotes")
M.delimitedTextobject("a", "'", "'") M.delimitedTextobject("a", "'", "'")
@ -70,18 +72,10 @@ function M.setup()
if status then if status then
wk.register({ wk.register({
["<leader>"] = { ["<leader>"] = {
f = { f = { name = "Files" },
name = "Files" g = { name = "Go to" },
}, r = { name = "Rename / Replace / Reload" },
g = { l = { name = "Local" },
name = "Go to"
},
r = {
name = "Rename / Replace / Reload"
},
["<leader>"] = {
name = "Easymotion"
},
v = "which_key_ignore" v = "which_key_ignore"
} }
}) })

View file

@ -38,9 +38,10 @@ 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", opt = true }, -- smooth scrolling { "psliwka/vim-smoothie", opt = true }, -- smooth scrolling
"easymotion/vim-easymotion", -- removes the need for spamming w or e -- "easymotion/vim-easymotion", -- removes the need for spamming w or e
"ggandor/leap.nvim", -- 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
"MunifTanjim/nui.nvim", -- ui stuff required by idris2 "MunifTanjim/nui.nvim", -- ui stuff required by idris2
"ShinKage/idris2-nvim", -- idris2 support "ShinKage/idris2-nvim", -- idris2 support

View file

@ -1,20 +0,0 @@
local M = {}
function M.setup()
local opts = function(desc)
return { desc = desc, silent = true }
end
local modes = { "n", "v", "o" }
vim.keymap.set(modes, "qf", "<Plug>(easymotion-bd-f)", opts("Hop to char"))
vim.keymap.set(modes, "qj", "<Plug>(easymotion-overwin-f2)", opts("Hop to char pair"))
vim.keymap.set(modes, "qw", "<Plug>(easymotion-bd-w)", opts("Hop to word"))
vim.keymap.set(modes, "qL", "<Plug>(easymotion-bd-L)", opts("Hop to line (?)"))
local status, wk = pcall(require, "which-key")
if status then wk.register({ q = { name = "Easymotion" } }, { mode = "o" }) end
end
return M

View file

@ -6,7 +6,6 @@ function M.setup()
require('fidget').setup() require('fidget').setup()
require('dressing').setup() require('dressing').setup()
require("my.plugins.easymotion").setup()
require("my.plugins.autopairs").setup() require("my.plugins.autopairs").setup()
require("my.plugins.telescope").setup() require("my.plugins.telescope").setup()
require("my.plugins.surround").setup() require("my.plugins.surround").setup()
@ -49,6 +48,7 @@ function M.setup()
require("my.plugins.paperplanes").setup() require("my.plugins.paperplanes").setup()
end end
require("my.plugins.leap").setup()
require("my.plugins.hydra").setup() require("my.plugins.hydra").setup()
require("my.plugins.clipboard-image").setup() require("my.plugins.clipboard-image").setup()
require("my.plugins.mind").setup() require("my.plugins.mind").setup()

View file

@ -0,0 +1,10 @@
local M = {}
function M.setup()
require("leap").add_default_mappings()
end
-- (something)
-- something
return M

View file

@ -1,9 +1,18 @@
local M = {} local M = {}
function M.setup() function M.setup()
vim.g.neovide_floating_blur_amount_x = 2.0 -- vim.g.neovide_floating_blur_amount_x = 3.0
vim.g.neovide_floating_blur_amount_y = 2.0 -- vim.g.neovide_floating_blur_amount_y = 3.0
-- vim.g.neovide_transparency = 0.8 -- vim.g.neovide_transparency = 1.0
-- vim.g.pumblend = 30
-- vim.api.nvim_create_autocmd("WinEnter", {
-- group = vim.api.nvim_create_augroup("Setup transparency", {}),
-- pattern = "*",
-- callback = function()
-- vim.wo.winblend = 30
-- end
-- })
end end
return M return M

View file

@ -19,17 +19,13 @@ local keybinds = {
{ "<Leader>fp", find_files_by_extension("purs"), "Find purescript files" }, { "<Leader>fp", find_files_by_extension("purs"), "Find purescript files" },
{ "<Leader>d", "diagnostics", "Diagnostics" }, { "<Leader>d", "diagnostics", "Diagnostics" },
{ "<C-F>", "live_grep", "Search in project" }, { "<C-F>", "live_grep", "Search in project" },
{ "<Leader>t", "builtin", "Show builtin pickers" }, { "<Leader>t", "builtin", "Show builtin pickers" }
} }
local chords = { local chords = { { "jp", "file_browser" } }
{ "jp", "file_browser" }
}
local function mkAction(action) local function mkAction(action)
if not string.find(action, "theme=") then if not string.find(action, "theme=") then action = with_theme(action, defaultTheme) end
action = with_theme(action, defaultTheme)
end
return ":Telescope " .. action .. "<cr>" return ":Telescope " .. action .. "<cr>"
end end
@ -39,9 +35,7 @@ local function setupKeybinds()
vim.keymap.set("n", mapping[1], mkAction(mapping[2]), { desc = mapping[3] }) vim.keymap.set("n", mapping[1], mkAction(mapping[2]), { desc = mapping[3] })
end end
for _, mapping in pairs(chords) do for _, mapping in pairs(chords) do arpeggio.chord("n", mapping[1], mkAction(mapping[2])) end
arpeggio.chord("n", mapping[1], mkAction(mapping[2]))
end
end end
function M.setup() function M.setup()
@ -50,11 +44,7 @@ function M.setup()
local settings = { local settings = {
defaults = { mappings = { i = { ["<C-h>"] = "which_key" } } }, defaults = { mappings = { i = { ["<C-h>"] = "which_key" } } },
pickers = { find_files = { hidden = true } }, pickers = { find_files = { hidden = true } },
extensions = { extensions = { file_browser = { path = "%:p:h" } }
file_browser = {
path = "%:p:h"
}
}
} }
require("telescope").setup(settings) require("telescope").setup(settings)

View file

@ -4,7 +4,8 @@ local M = {}
function M.setup() function M.setup()
wk.setup({ wk.setup({
triggers = { "<leader>", "d", "y", "q", "z", "g", "c" }, -- triggers = { "<leader>", "d", "y", "q", "z", "g", "c" },
triggers = {},
show_help = false, show_help = false,
show_keys = false show_keys = false
}) })

View file

@ -75,7 +75,7 @@
"stylix", "stylix",
"nixpkgs" "nixpkgs"
], ],
"utils": "utils" "utils": "utils_2"
}, },
"locked": { "locked": {
"lastModified": 1659649195, "lastModified": 1659649195,
@ -284,19 +284,20 @@
"inputs": { "inputs": {
"nixpkgs": [ "nixpkgs": [
"nixpkgs" "nixpkgs"
] ],
"utils": "utils"
}, },
"locked": { "locked": {
"lastModified": 1667907331, "lastModified": 1670253003,
"narHash": "sha256-bHkAwkYlBjkupPUFcQjimNS8gxWSWjOTevEuwdnp5m0=", "narHash": "sha256-/tJIy4+FbsQyslq1ipyicZ2psOEd8dvl4OJ9lfisjd0=",
"owner": "nix-community", "owner": "nix-community",
"repo": "home-manager", "repo": "home-manager",
"rev": "6639e3a837fc5deb6f99554072789724997bc8e5", "rev": "0e8125916b420e41bf0d23a0aa33fadd0328beb3",
"type": "github" "type": "github"
}, },
"original": { "original": {
"owner": "nix-community", "owner": "nix-community",
"ref": "release-22.05", "ref": "release-22.11",
"repo": "home-manager", "repo": "home-manager",
"type": "github" "type": "github"
} }
@ -583,16 +584,16 @@
}, },
"nixpkgs": { "nixpkgs": {
"locked": { "locked": {
"lastModified": 1669861251, "lastModified": 1670263920,
"narHash": "sha256-QyBI5QNT/nQRkCsZHnN3ImKCaxrtMArVqNioA7diwU4=", "narHash": "sha256-oR1rtMcWCvpGa81vvaHpONLFfZJpq1ijnHypujGA/lw=",
"owner": "nixos", "owner": "nixos",
"repo": "nixpkgs", "repo": "nixpkgs",
"rev": "af4d0d532f413ad2fbb3a13f47c98c9fca1948e1", "rev": "29423d0cfac3baa05f804c399f1b043068b531f8",
"type": "github" "type": "github"
}, },
"original": { "original": {
"owner": "nixos", "owner": "nixos",
"ref": "release-22.05", "ref": "release-22.11",
"repo": "nixpkgs", "repo": "nixpkgs",
"type": "github" "type": "github"
} }
@ -779,6 +780,21 @@
} }
}, },
"utils": { "utils": {
"locked": {
"lastModified": 1667395993,
"narHash": "sha256-nuEHfE/LcWyuSWnS8t12N1wc105Qtau+/OdUAjtQ0rA=",
"owner": "numtide",
"repo": "flake-utils",
"rev": "5aed5285a952e0b949eb3ba02c12fa4fcfef535f",
"type": "github"
},
"original": {
"owner": "numtide",
"repo": "flake-utils",
"type": "github"
}
},
"utils_2": {
"locked": { "locked": {
"lastModified": 1642700792, "lastModified": 1642700792,
"narHash": "sha256-XqHrk7hFb+zBvRg6Ghl+AZDq03ov6OshJLiSWOoX5es=", "narHash": "sha256-XqHrk7hFb+zBvRg6Ghl+AZDq03ov6OshJLiSWOoX5es=",

View file

@ -2,12 +2,12 @@
description = "NixOS configuration"; description = "NixOS configuration";
inputs = { inputs = {
nixpkgs.url = "github:nixos/nixpkgs/release-22.05"; nixpkgs.url = "github:nixos/nixpkgs/release-22.11";
nixos-unstable.url = "github:nixos/nixpkgs/nixos-unstable"; nixos-unstable.url = "github:nixos/nixpkgs/nixos-unstable";
nixpkgs-unstable.url = "github:nixos/nixpkgs/nixpkgs-unstable"; nixpkgs-unstable.url = "github:nixos/nixpkgs/nixpkgs-unstable";
home-manager = { home-manager = {
url = "github:nix-community/home-manager/release-22.05"; url = "github:nix-community/home-manager/release-22.11";
inputs.nixpkgs.follows = "nixpkgs"; inputs.nixpkgs.follows = "nixpkgs";
}; };

View file

@ -29,6 +29,6 @@
swapDevices = [ ]; swapDevices = [ ];
nix.maxJobs = lib.mkDefault 8; nix.settings.max-jobs = lib.mkDefault 8;
powerManagement.cpuFreqGovernor = lib.mkDefault "powersave"; powerManagement.cpuFreqGovernor = lib.mkDefault "powersave";
} }

View file

@ -3,7 +3,6 @@
./git ./git
./shells ./shells
# ./wakatime # ./wakatime
./xmonad
./rofi ./rofi
# ./xmodmap # ./xmodmap
@ -17,7 +16,7 @@
./locale.nix ./locale.nix
# ./memes.nix # ./memes.nix
./alacritty.nix ./alacritty.nix
./postgres.nix # ./postgres.nix
./neovim.nix ./neovim.nix
./tmux.nix ./tmux.nix
./kmonad.nix ./kmonad.nix

View file

@ -1,4 +1,4 @@
{ ... }: { { pkgs, ... }: {
i18n.defaultLocale = "en_US.UTF-8"; i18n.defaultLocale = "en_US.UTF-8";
# time.timeZone = "Europe/Bucharest"; # time.timeZone = "Europe/Bucharest";
time.timeZone = "Europe/Amsterdam"; time.timeZone = "Europe/Amsterdam";
@ -8,6 +8,10 @@
# ibus.engines = with pkgs.ibus-engines; [ /* any engine you want, for example */ anthy ]; # ibus.engines = with pkgs.ibus-engines; [ /* any engine you want, for example */ anthy ];
}; };
environment.systemPackages = [
pkgs.source-code-pro
];
console = { console = {
keyMap = "us"; keyMap = "us";
font = "SourceCodePro"; font = "SourceCodePro";

View file

@ -32,9 +32,6 @@ let
in in
{ {
home-manager.users.adrielus.programs = { home-manager.users.adrielus.programs = {
# Add tmux-navigator plugin to neovim
# neovim.extraPackages = [ pkgs.vimPlugins.vim-tmux-navigator ];
tmux = { tmux = {
enable = true; enable = true;

View file

@ -1,29 +0,0 @@
{ pkgs, ... }: {
home-manager.users.adrielus = {
# xsession.windowManager.xmonad = {
# enable = true;
# enableContribAndExtras = true;
# config = ./Main.hs;
# };
home.packages = with pkgs; [ xwallpaper ];
# Tell KDE to use xmonad
# home.file.".config/plasma-workspace/env/set_window_manager.sh".text =
# "export KDEWM=/home/adrielus/.nix-profile/bin/xmonad";
services.picom = {
enable = false;
blur = true;
shadow = false;
extraOptions = ''
blur:
{
method = "gaussian";
size = 10;
deviation = 5.0;
};
'';
};
};
}

View file

@ -85,8 +85,6 @@ in
}; };
opacity = transparency; opacity = transparency;
gtk_theme_variant = v "light" "dark";
}; };
}; };
}; };

View file

@ -2,6 +2,7 @@
# https://www.codyhiar.com/blog/how-to-set-desktop-wallpaper-on-nixos/ # https://www.codyhiar.com/blog/how-to-set-desktop-wallpaper-on-nixos/
{ pkgs, config, ... }: { { pkgs, config, ... }: {
home-manager.users.adrielus = { home-manager.users.adrielus = {
home.packages = with pkgs; [ xwallpaper ];
xdg.configFile."wallpaper".source = pkgs.myThemes.current.wallpaper; xdg.configFile."wallpaper".source = pkgs.myThemes.current.wallpaper;
xsession = { xsession = {
enable = true; enable = true;