From f7ffba2266f4dc376b52d7f65ba2873d9c7921c9 Mon Sep 17 00:00:00 2001 From: Sam Date: Sat, 14 Sep 2024 20:19:07 +0100 Subject: [PATCH] add nvim buffer switch keymap & change dbt models --- flake.lock | 8 ++--- home/common/core/nixvim/keymaps.nix | 38 ++++++++++++------------ home/common/core/nixvim/plugins/lsp.nix | 22 +++++++------- hosts/common/users/sam/default.nix | 39 +++++++++++++++---------- 4 files changed, 57 insertions(+), 50 deletions(-) diff --git a/flake.lock b/flake.lock index 9a9c8b0..f006187 100644 --- a/flake.lock +++ b/flake.lock @@ -361,11 +361,11 @@ "nix-secrets": { "flake": false, "locked": { - "lastModified": 1722540163, - "narHash": "sha256-5/sOGSmWksxMKuLzcpWBMYRkphFLcz7XensO2gwEC/4=", + "lastModified": 1726340825, + "narHash": "sha256-6gv36ea3aAjJH7osZVzVU0GRoJeVR+iwSP9bSaJC+MI=", "ref": "refs/heads/master", - "rev": "a403495cd9a28b44b10c64cc340d04d759b6d21c", - "revCount": 158, + "rev": "73d4d304a201f7db200ffb5955c8a2f521f635a7", + "revCount": 160, "type": "git", "url": "ssh://git@git.bitlab21.com/sam/nix-secrets.git" }, diff --git a/home/common/core/nixvim/keymaps.nix b/home/common/core/nixvim/keymaps.nix index a206604..98141a3 100644 --- a/home/common/core/nixvim/keymaps.nix +++ b/home/common/core/nixvim/keymaps.nix @@ -2,32 +2,32 @@ programs.nixvim.keymaps = [ # Switching buffers { - mode = [ "n" ]; - action = "h"; + mode = ["n"]; + action = "h"; key = ""; options = { silent = true; }; } { - mode = [ "n" ]; - action = "j"; + mode = ["n"]; + action = "j"; key = ""; options = { silent = true; }; } { - mode = [ "n" ]; - action = "k"; + mode = ["n"]; + action = "k"; key = ""; options = { silent = true; }; } { - mode = [ "n" ]; - action = "l"; + mode = ["n"]; + action = "l"; key = ""; options = { silent = true; @@ -36,7 +36,7 @@ # Toggle nvim-tree { - mode = [ "n" ]; + mode = ["n"]; action = "NvimTreeFindFileToggle"; key = "tt"; options = { @@ -46,40 +46,40 @@ # Clear search highlighting { - mode = [ "n" ]; + mode = ["n"]; key = ""; action = "nohlsearch"; - options = { noremap = true; }; + options = {noremap = true;}; } # Telescope Plugin { # find files - mode = [ "n" ]; + mode = ["n"]; key = "ff"; action = "Telescope find_files"; - options = { noremap = true; }; + options = {noremap = true;}; } { # live grep - mode = [ "n" ]; + mode = ["n"]; key = "fg"; action = "Telescope live_grep"; - options = { noremap = true; }; + options = {noremap = true;}; } { # buffers - mode = [ "n" ]; + mode = ["n"]; key = "fb"; action = "Telescope buffers"; - options = { noremap = true; }; + options = {noremap = true;}; } { # help tags - mode = [ "n" ]; + mode = ["n"]; key = "fh"; action = "Telescope help_tags"; - options = { noremap = true; }; + options = {noremap = true;}; } ]; } diff --git a/home/common/core/nixvim/plugins/lsp.nix b/home/common/core/nixvim/plugins/lsp.nix index ab341de..9aeb99e 100644 --- a/home/common/core/nixvim/plugins/lsp.nix +++ b/home/common/core/nixvim/plugins/lsp.nix @@ -3,16 +3,16 @@ lsp = { enable = true; servers = { - lua-ls = { enable = true; }; - nixd = { enable = true; }; - bashls = { enable = true; }; - pyright = { enable = true; }; - html = { enable = true; }; - marksman = { enable = true; }; - ccls = { enable = true; }; - cssls = { enable = true; }; - r-language-server = { enable = true; }; - tsserver = { enable = true; }; + lua-ls = {enable = true;}; + nixd = {enable = true;}; + bashls = {enable = true;}; + pyright = {enable = true;}; + html = {enable = true;}; + marksman = {enable = true;}; + ccls = {enable = true;}; + cssls = {enable = true;}; + r-language-server = {enable = true;}; + tsserver = {enable = true;}; }; keymaps = { lspBuf = { @@ -36,7 +36,7 @@ action = "type_definition"; desc = "Type Definition"; }; - K = { + gK = { action = "hover"; desc = "Hover"; }; diff --git a/hosts/common/users/sam/default.nix b/hosts/common/users/sam/default.nix index 9d8bd08..81dd451 100644 --- a/hosts/common/users/sam/default.nix +++ b/hosts/common/users/sam/default.nix @@ -44,12 +44,15 @@ in { "github-access-token" = { mode = "0655"; }; - "software/postgres/btc_models/password" = {}; - "software/postgres/btc_models/ip" = {}; - "software/postgres/btc_models/username" = {}; + "software/postgres/baseddata_models/password" = {}; + "software/postgres/baseddata_models/ip" = {}; + "software/postgres/baseddata_models/username" = {}; "software/postgres/osm/password" = {}; "software/postgres/osm/ip" = {}; "software/postgres/osm/username" = {}; + "software/postgres/bitcoin/password" = {}; + "software/postgres/bitcoin/ip" = {}; + "software/postgres/bitcoin/username" = {}; "software/zotero/username" = {}; "software/zotero/password" = {}; "software/zotero/guid" = {}; @@ -66,16 +69,20 @@ in { content = '' [ { - "url": "postgresql://${config.sops.placeholder."software/postgres/btc_models/username"}:${config.sops.placeholder."software/postgres/btc_models/password"}@${config.sops.placeholder."software/postgres/btc_models/ip"}/btc_models", - "name": "btc_models" + "url": "postgresql://${config.sops.placeholder."software/postgres/baseddata_models/username"}:${config.sops.placeholder."software/postgres/baseddata_models/password"}@${config.sops.placeholder."software/postgres/baseddata_models/ip"}/btc_models", + "name": "baseddata_models" }, { - "url": "postgresql://${config.sops.placeholder."software/postgres/btc_models/username"}:${config.sops.placeholder."software/postgres/btc_models/password"}@${config.sops.placeholder."software/postgres/btc_models/ip"}/dev_btc_models", - "name": "dev_btc_models" + "url": "postgresql://${config.sops.placeholder."software/postgres/baseddata_models/username"}:${config.sops.placeholder."software/postgres/baseddata_models/password"}@${config.sops.placeholder."software/postgres/baseddata_models/ip"}/dev_baseddata_models", + "name": "dev_baseddata_models" }, { "url": "postgresql://${config.sops.placeholder."software/postgres/osm/username"}:${config.sops.placeholder."software/postgres/osm/password"}@${config.sops.placeholder."software/postgres/osm/ip"}/osm", "name": "osm" + }, + { + "url": "postgresql://${config.sops.placeholder."software/postgres/bitcoin/username"}:${config.sops.placeholder."software/postgres/bitcoin/password"}@${config.sops.placeholder."software/postgres/bitcoin/ip"}/bitcoin", + "name": "bitcoin" } ] ''; @@ -86,27 +93,27 @@ in { owner = "${username}"; mode = "0600"; content = '' - bitcoin: + baseddata: target: dev outputs: dev: - dbname: dev_btc_models - host: ${config.sops.placeholder."software/postgres/btc_models/ip"} - pass: '${config.sops.placeholder."software/postgres/btc_models/password"}' + dbname: dev_baseddata_models + host: ${config.sops.placeholder."software/postgres/baseddata_models/ip"} + pass: '${config.sops.placeholder."software/postgres/baseddata_models/password"}' port: 5432 schema: models threads: 6 type: postgres - user: ${config.sops.placeholder."software/postgres/btc_models/username"} + user: ${config.sops.placeholder."software/postgres/baseddata_models/username"} prod: - dbname: btc_models - host: ${config.sops.placeholder."software/postgres/btc_models/ip"} - pass: '${config.sops.placeholder."software/postgres/btc_models/password"}' + dbname: baseddata_models + host: ${config.sops.placeholder."software/postgres/baseddata_models/ip"} + pass: '${config.sops.placeholder."software/postgres/baseddata_models/password"}' port: 5432 schema: models threads: 6 type: postgres - user: ${config.sops.placeholder."software/postgres/btc_models/username"} + user: ${config.sops.placeholder."software/postgres/baseddata_models/username"} ''; };