Configure obsidian.nvim keybinds & more
- configure obsidian nvim keybinds - fix typo: `img` => `imv` - re-enable docker on tethys (also adds a hacky mysql db for... reasons)
This commit is contained in:
parent
e71a356d65
commit
e4b7645102
|
@ -1,49 +0,0 @@
|
||||||
local M = {}
|
|
||||||
|
|
||||||
function M.setup()
|
|
||||||
-- Disable filetype.vim
|
|
||||||
vim.g.do_filetype_lua = true
|
|
||||||
vim.g.did_load_filetypes = false
|
|
||||||
|
|
||||||
-- Basic options
|
|
||||||
vim.opt.joinspaces = false -- No double spaces with join
|
|
||||||
vim.opt.list = true -- Show some invisible characters
|
|
||||||
vim.opt.cmdheight = 0 -- Hide command line when it's not getting used
|
|
||||||
|
|
||||||
-- tcqj are there by default, and "r" automatically continues comments on enter
|
|
||||||
vim.opt.formatoptions = "tcqjr"
|
|
||||||
|
|
||||||
-- Line numbers
|
|
||||||
vim.opt.number = true -- Show line numbers
|
|
||||||
vim.opt.relativenumber = true -- Relative line numbers
|
|
||||||
|
|
||||||
vim.opt.expandtab = true -- Use spaces for the tab char
|
|
||||||
vim.opt.shiftwidth = 2 -- Size of an indent
|
|
||||||
vim.opt.tabstop = 2 -- Size of tab character
|
|
||||||
vim.opt.shiftround = true -- When using < or >, rounds to closest multiple of shiftwidth
|
|
||||||
vim.opt.smartindent = true -- Insert indents automatically
|
|
||||||
|
|
||||||
vim.opt.scrolloff = 4 -- Starts scrolling 4 lines from the edge of the screen
|
|
||||||
vim.opt.termguicolors = true -- True color support
|
|
||||||
|
|
||||||
vim.opt.ignorecase = true -- Ignore case
|
|
||||||
vim.opt.smartcase = true -- Do not ignore case with capitals
|
|
||||||
|
|
||||||
vim.opt.splitbelow = true -- Put new windows below current
|
|
||||||
vim.opt.splitright = true -- Put new windows right of current
|
|
||||||
|
|
||||||
vim.opt.wrap = false -- Disable line wrap (by default)
|
|
||||||
vim.opt.wildmode = { "list", "longest" } -- Command-line completion mode
|
|
||||||
vim.opt.completeopt = { "menu", "menuone", "noselect" }
|
|
||||||
|
|
||||||
vim.opt.undofile = true -- persist undos!!
|
|
||||||
|
|
||||||
-- Set leader
|
|
||||||
vim.g.mapleader = " "
|
|
||||||
|
|
||||||
-- Folding
|
|
||||||
vim.opt.foldmethod = "marker" -- use {{{ }}} for folding
|
|
||||||
vim.opt.foldcolumn = "1" -- show column with folds on the left
|
|
||||||
end
|
|
||||||
|
|
||||||
return M
|
|
|
@ -1311,14 +1311,26 @@ let
|
||||||
package = "epwalsh/obsidian.nvim";
|
package = "epwalsh/obsidian.nvim";
|
||||||
dependencies.lua = [ "plenary" ];
|
dependencies.lua = [ "plenary" ];
|
||||||
|
|
||||||
|
event = "VeryLazy";
|
||||||
cond = [
|
cond = [
|
||||||
(blacklist [ "vscode" "firenvim" ])
|
(blacklist [ "vscode" "firenvim" ])
|
||||||
(lua /* lua */ "vim.loop.cwd() == ${encode vault}")
|
(lua /* lua */ "vim.loop.cwd() == ${encode vault}")
|
||||||
];
|
];
|
||||||
event = "VeryLazy";
|
|
||||||
|
|
||||||
keys.mapping = "<C-O>";
|
config.keys =
|
||||||
keys.action = "<cmd>ObsidianQuickSwitch<cr>";
|
let nmap = mapping: action: desc: {
|
||||||
|
inherit mapping desc;
|
||||||
|
action = "<cmd>Obsidian${action}<cr>";
|
||||||
|
};
|
||||||
|
in
|
||||||
|
[
|
||||||
|
(nmap "<C-O>" "QuickSwitch<cr>" "[o]pen note")
|
||||||
|
(nmap "<leader>ot" "Today" "[t]oday's note")
|
||||||
|
(nmap "<leader>oy" "Yesterday" "[y]esterday's note")
|
||||||
|
(nmap "<leader>oi" "Template" "[i]nstantiate template")
|
||||||
|
(nmap "<leader>on" "Template New note.md" "new [n]ote template")
|
||||||
|
(nmap "<leader>od" "Template New note.md" "new [d]ream template")
|
||||||
|
];
|
||||||
|
|
||||||
opts = {
|
opts = {
|
||||||
dir = vault;
|
dir = vault;
|
||||||
|
|
|
@ -47,7 +47,7 @@
|
||||||
# }}}
|
# }}}
|
||||||
# {{{ Media playing/recording
|
# {{{ Media playing/recording
|
||||||
mpv # Video player
|
mpv # Video player
|
||||||
img # Image viewer
|
imv # Image viewer
|
||||||
# peek # GIF recorder
|
# peek # GIF recorder
|
||||||
# obs-studio # video recorder
|
# obs-studio # video recorder
|
||||||
# }}}
|
# }}}
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
{ lib, ... }: {
|
{ lib, pkgs, ... }: {
|
||||||
# {{{ Imports
|
# {{{ Imports
|
||||||
imports = [
|
imports = [
|
||||||
../common/global
|
../common/global
|
||||||
|
@ -41,7 +41,7 @@
|
||||||
programs.kdeconnect.enable = true;
|
programs.kdeconnect.enable = true;
|
||||||
programs.firejail.enable = true;
|
programs.firejail.enable = true;
|
||||||
programs.extra-container.enable = true;
|
programs.extra-container.enable = true;
|
||||||
# virtualisation.docker.enable = true;
|
virtualisation.docker.enable = true;
|
||||||
# virtualisation.spiceUSBRedirection.enable = true; # This was required for the vm usb passthrough tomfoolery
|
# virtualisation.spiceUSBRedirection.enable = true; # This was required for the vm usb passthrough tomfoolery
|
||||||
# }}}
|
# }}}
|
||||||
# {{{ Ad-hoc stylix targets
|
# {{{ Ad-hoc stylix targets
|
||||||
|
@ -61,4 +61,9 @@
|
||||||
in
|
in
|
||||||
blacklist;
|
blacklist;
|
||||||
# }}}
|
# }}}
|
||||||
|
|
||||||
|
services.mysql = {
|
||||||
|
enable = true;
|
||||||
|
package = pkgs.mysql80;
|
||||||
|
};
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue