Skip to content

Commit

Permalink
many things
Browse files Browse the repository at this point in the history
  • Loading branch information
megalithic committed Nov 16, 2022
1 parent 6051650 commit d5c9cca
Show file tree
Hide file tree
Showing 17 changed files with 111 additions and 60 deletions.
1 change: 1 addition & 0 deletions asdf/default-npm-packages
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ ls_emmet
lua-fmt
markdownlint
neovim
node-fetch
prettier
prettier-plugin-eex
prettier-plugin-tailwindcss
Expand Down
7 changes: 4 additions & 3 deletions config/kitty/kitty.conf
Original file line number Diff line number Diff line change
Expand Up @@ -284,9 +284,10 @@ close_on_child_death yes
# clipboard_control write-clipboard write-primary read-clipboard
clipboard_control write-clipboard write-primary read-clipboard-ask read-primary-ask

# Thanks `page-down`!
# https://github.com/kovidgoyal/kitty/issues/719#issuecomment-952039731
# scrollback_pager ~/.config/kitty/pager.sh 'INPUT_LINE_NUMBER' 'CURSOR_LINE' 'CURSOR_COLUMN'
# https://github.com/kovidgoyal/kitty/issues/719
# https://www.reddit.com/r/neovim/comments/qqf4nn/psa_you_can_use_neovim_as_the_kitty_terminal/
# https://www.reddit.com/r/KittyTerminal/comments/l73ulu/pager/
scrollback_pager nvim --noplugin -u ~/.dotfiles/config/nvim/vimrc -c "syntax on|set t_Co=256|set termguicolors|setlocal nomodifiable nonumber nolist showtabline=0 foldcolumn=0 ft=man|colorscheme forestbones" -c "autocmd VimEnter * cnoremap q q!|nnoremap q :q!<CR>|normal G" -c "silent write! /tmp/kitty_scrollback_buffer | te cat /tmp/kitty_scrollback_buffer - "

globinclude maps.conf

Expand Down
4 changes: 2 additions & 2 deletions config/kitty/maps.conf
Original file line number Diff line number Diff line change
Expand Up @@ -74,8 +74,8 @@ map ctrl+space>ctrl+e launch --type=window zsh -lc "zk edit --interactive"
# map ctrl+space>ctrl+enter launch --type=overlay zsh -ic "~/.dotfiles/bin/kittymux"
# map ctrl+space>ctrl+enter kitten sessioner.py "~/.dotfiles/config/kitty/sessions"

# map ctrl+space>ctrl+b show_scrollback
map ctrl+space>ctrl+b launch --title "kitty scrollback buffer" --stdin-source=@screen_scrollback --type=overlay nvim -c "set ft=kittybuf | TSBufEnable bash | let g:auto_session_enabled = v:false" -
map ctrl+space>ctrl+b show_scrollback
# map ctrl+space>ctrl+b launch --title "kitty scrollback buffer" --stdin-source=@screen_scrollback --type=overlay nvim -c "set ft=kittybuf | TSBufEnable bash | let g:auto_session_enabled = v:false" -

# -- Window management ----------------------------------------------------- {{{
# movements for nvim in kitty, across splits (like tmux-navigate)
Expand Down
2 changes: 2 additions & 0 deletions config/kitty/themes/megaforest.conf
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,9 @@ background #323d43

url_color #415c6d
url_color #0087BD

cursor #83b6af
# cursor #505a60

# black
color0 #505a60
Expand Down
4 changes: 1 addition & 3 deletions config/nvim/lua/mega/options.lua
Original file line number Diff line number Diff line change
Expand Up @@ -419,6 +419,7 @@ local disabled_built_ins = {
"gzip",
"loaded_tutor_mode_plugin",
"logipat",
-- "man",
"matchit",
"matchparen",
"netrwFileHandlers",
Expand Down Expand Up @@ -506,9 +507,6 @@ do
-- if not ok then
-- vim.schedule(function() vim.notify(fmt("Colorscheme failed to load because: %s", msg), "error") end)
-- end

-- nvim as man pager
vim.cmd("runtime ftplugin/man.vim")
end

-- vim:foldmethod=marker
22 changes: 11 additions & 11 deletions config/nvim/lua/mega/plugins/cmp.lua
Original file line number Diff line number Diff line change
Expand Up @@ -142,12 +142,12 @@ return function()
-- end,
},
},
-- {
-- name = "rg",
-- keyword_length = 4,
-- max_item_count = 10,
-- option = { additional_arguments = "--max-depth 8" },
-- },
{
name = "rg",
keyword_length = 4,
max_item_count = 10,
option = { additional_arguments = "--max-depth 8" },
},
-- }, {
-- {
-- name = "buffer",
Expand Down Expand Up @@ -256,9 +256,9 @@ return function()
-- https://github.com/rafamadriz/NeoCode/blob/main/lua/modules/plugins/completion.lua#L130-L192
end

require("cmp.entry").get_documentation = function(self)
local item = self:get_completion_item()
if item.documentation then return require("mega.utils").format_markdown(item.documentation) end
return {}
end
-- require("cmp.entry").get_documentation = function(self)
-- local item = self:get_completion_item()
-- if item.documentation then return require("mega.utils").format_markdown(item.documentation) end
-- return {}
-- end
end
3 changes: 2 additions & 1 deletion config/nvim/lua/mega/plugins/firenvim.lua
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,8 @@ return function()
"q",
"<cmd>call firenvim#hide_frame() | call firenvim#focus_page()<CR><Esc>norm! ggdGa<CR>"
)
vim.opt.guifont = "JetBrainsMono_Nerd_Font_Mono:h22"
-- vim.opt.guifont = "JetBrainsMono_Nerd_Font_Mono:h22"
vim.opt.guifont = "JetBrainsMono Nerd Font Mono:h22"
-- P(fmt("lines: %s, win_height: %s", vim.o.lines, vim.api.nvim_win_get_height(vim.api.nvim_get_current_win())))
Expand Down
69 changes: 41 additions & 28 deletions config/nvim/lua/mega/plugins/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -93,29 +93,19 @@ local function plugins(use)
use({ "lukas-reineke/virt-column.nvim" })
use({ "MunifTanjim/nui.nvim" })
use({ "folke/which-key.nvim", ext = "which-key" })
use({ "phaazon/hop.nvim", ext = "hop" })
-- @trial multi-cursor: https://github.com/brendalf/dotfiles/blob/master/.config/nvim/lua/core/multi-cursor.lua
use({
"ggandor/leap.nvim",
config = function()
require("leap").setup({
equivalence_classes = { " \t\r\n", "([{", ")]}", "`\"'" },
})
end,
})
use({
"ggandor/flit.nvim",
wants = { "leap.nvim" },
after = "leap.nvim",
"nvim-zh/colorful-winsep.nvim",
config = function()
require("flit").setup({
keys = { f = "f", F = "F", t = "t", T = "T" },
-- A string like "nv", "nvo", "o", etc.
labeled_modes = "nvo",
multiline = false,
require("colorful-winsep").setup({
highlight = {
guibg = "NONE",
guifg = mega.colors.grey0.hex,
-- guifg = "#1F3442",
},
})
end,
})

use({ "echasnovski/mini.nvim", ext = "mini", after = "nvim-treesitter" })
use({ "anuvyklack/hydra.nvim", ext = "hydra" })
use({
Expand All @@ -124,7 +114,6 @@ local function plugins(use)
module = "notify",
cond = function() return vim.g.notifier_enabled end,
})

use({ "nanozuki/tabby.nvim", ext = "tabby" })
use({
"lukas-reineke/indent-blankline.nvim",
Expand Down Expand Up @@ -174,6 +163,31 @@ local function plugins(use)
end,
})

-- ( Movements ) -------------------------------------------------------------
use({ "phaazon/hop.nvim", ext = "hop" })
-- @trial multi-cursor: https://github.com/brendalf/dotfiles/blob/master/.config/nvim/lua/core/multi-cursor.lua
use({
"ggandor/leap.nvim",
config = function()
require("leap").setup({
equivalence_classes = { " \t\r\n", "([{", ")]}", "`\"'" },
})
end,
})
use({
"ggandor/flit.nvim",
wants = { "leap.nvim" },
after = "leap.nvim",
config = function()
require("flit").setup({
keys = { f = "f", F = "F", t = "t", T = "T" },
-- A string like "nv", "nvo", "o", etc.
labeled_modes = "nvo",
multiline = false,
})
end,
})

-- ( Telescope ) -------------------------------------------------------------
use({
"nvim-telescope/telescope.nvim",
Expand Down Expand Up @@ -207,11 +221,11 @@ local function plugins(use)
after = "telescope.nvim",
config = function() require("telescope").load_extension("media_files") end,
})
use({
"ryansch/habitats.nvim",
after = "telescope-file-browser.nvim",
config = function() require("habitats").setup({}) end,
})
-- use({
-- "ryansch/habitats.nvim",
-- after = "telescope-file-browser.nvim",
-- config = function() require("habitats").setup({}) end,
-- })

-- ( FZF ) -------------------------------------------------------------------
use({ "ibhagwan/fzf-lua", ext = "fzf" })
Expand Down Expand Up @@ -539,7 +553,6 @@ local function plugins(use)
ext = "cmp",
after = "LuaSnip",
module = "cmp",
-- event = "InsertEnter",
requires = {
{ "saadparwaiz1/cmp_luasnip", after = "nvim-cmp" },
{ "hrsh7th/cmp-buffer", after = "nvim-cmp" },
Expand Down Expand Up @@ -879,7 +892,7 @@ local function plugins(use)
})

-- ( Notes/Docs ) ------------------------------------------------------------
use({ "ixru/nvim-markdown" })
-- use({ "ixru/nvim-markdown" })
use({ "iamcco/markdown-preview.nvim", ft = "md", run = "cd app && yarn install" })
use({
"toppair/peek.nvim",
Expand All @@ -902,7 +915,7 @@ local function plugins(use)
use({ "mickael-menu/zk-nvim", ext = "zk", after = "telescope.nvim" })
use({
"gaoDean/autolist.nvim",
config = function() require("autolist").setup({ normal_mappings = { invert = { "<C-x>" } } }) end,
config = function() require("autolist").setup({ normal_mappings = { invert = { "<c-c>" } } }) end,
})
use({ "ellisonleao/glow.nvim" })
use({
Expand Down Expand Up @@ -939,7 +952,7 @@ local function plugins(use)

-- ( Syntax/Languages ) ------------------------------------------------------
use({ "ii14/emmylua-nvim" })
-- use({ "elixir-editors/vim-elixir" })
use({ "elixir-editors/vim-elixir" })
-- use({ "tpope/vim-rails" })
-- use({ "ngscheurich/edeex.nvim" })
-- use({ "antew/vim-elm-analyse" })
Expand Down
4 changes: 0 additions & 4 deletions config/nvim/lua/mega/plugins/neo-tree.lua
Original file line number Diff line number Diff line change
Expand Up @@ -58,10 +58,6 @@ return function()
event = "neo_tree_popup_buffer_enter",
handler = function(args) vim.cmd("highlight! Cursor blend=0") end,
},
{
event = "neo_tree_popup_buffer_leave",
handler = function(args) vim.cmd("highlight! Cursor blend=100") end,
},
},
filesystem = {
hijack_netrw_behavior = "open_current",
Expand Down
2 changes: 1 addition & 1 deletion config/nvim/lua/mega/plugins/utils.lua
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ local function setup_autocmds()
mega.augroup("PackerSetupInit", {
{
event = { "BufWritePost" },
pattern = { "*/mega/plugins/*.lua" },
pattern = { "*/mega/plugins/*.lua", "*/mega/lsp/servers.lua" },
desc = "setup and reloaded",
command = mega.reload,
},
Expand Down
2 changes: 1 addition & 1 deletion config/nvim/plugin/lsp.lua
Original file line number Diff line number Diff line change
Expand Up @@ -242,7 +242,7 @@ local function setup_keymaps(client, bufnr)
[[<cmd>lua =vim.lsp.get_active_clients()[1].server_capabilities<CR>]],
desc("server capabilities")
)
nnoremap("<leader>lil", [[<cmd>lua vim.cmd("vnew " .. vim.lsp.get_log_path())<CR>]], desc("lsp logs (vsplit)"))
nnoremap("<leader>lil", [[<cmd>LspLog<CR>]], desc("logs (vsplit)"))
nnoremap("<leader>lf", vim.lsp.buf.format, desc("format buffer"))
nnoremap("<leader>lft", [[<cmd>ToggleNullFormatters<cr>]], desc("toggle formatting"))
nnoremap("=", function() vim.lsp.buf.format({ buffer = bufnr, async = true }) end, desc("lsp: format buffer"))
Expand Down
2 changes: 2 additions & 0 deletions config/nvim/templates/skeleton.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
#!/usr/bin/env bash

# REF: https://github.com/andrewferrier/dotfiles/blob/main/common/.config/nvim/skeleton/sh

[[ -f "$HOME/.config/zsh/lib/helpers.zsh" ]] && source "$HOME/.config/zsh/lib/helpers.zsh"

set -euo pipefail
Expand Down
2 changes: 2 additions & 0 deletions config/nvim/vimrc
Original file line number Diff line number Diff line change
Expand Up @@ -328,3 +328,5 @@ let g:loaded_zipPlugin = 1

""" Custom Commands
command! Code execute ":!code -g %:p\:" . line('.') . ":" . col('.')

autocmd VimEnter * cnoremap q q!|nnoremap q q!
4 changes: 2 additions & 2 deletions git/gitconfig
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,8 @@

c = commit
cv = commit -v
; cm = commit -m
cm = !git commit -m "$(gum input)" -m "$(gum write)"
cm = commit -m
; cm = !git commit -m "$(gum input)" -m "$(gum write)"
ca = commit --amend
cp = commit -p

Expand Down
5 changes: 5 additions & 0 deletions home/iex.exs
Original file line number Diff line number Diff line change
Expand Up @@ -156,4 +156,9 @@ IO.puts("")
Application.put_env(:elixir, :dbg_callback, {Macro, :dbg, []})
Application.put_env(:elixir, :ansi_enabled, true)

if function_exported?(Mix, :__info__, 1) and Mix.env() == :dev do
# if statement guards you from running it in prod, which could result in loss of logs.
Logger.configure_backend(:console, device: Process.group_leader())
end

# vim:ft=elixir
36 changes: 33 additions & 3 deletions misc/newtab/fns.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@ const shrug_indicator = "¯\\_(ツ)_/¯";

const loader = (parent, enabled, indicator) => {
indicator = indicator || loading_indicator;
const parentEl = (typeof parent == "string" && document.querySelector(parent)) || parent;
const parentEl =
(typeof parent == "string" && document.querySelector(parent)) || parent;
let loaderEl;

if (parent && parentEl) {
Expand Down Expand Up @@ -115,12 +116,14 @@ const weather = (enabled) => {
"background: linear-gradient(to bottom, #7FC7FA, #FFFFFF 65%); -webkit-background-clip: text; -webkit-text-fill-color: transparent;";
break;
case "Light rain":
wEl.querySelector("em").innerHTML = wEl.querySelector("em").innerHTML + " &#x1F327;";
wEl.querySelector("em").innerHTML =
wEl.querySelector("em").innerHTML + " &#x1F327;";
break;
case "Rain, mist":
wEl.querySelector("em").style =
"background: linear-gradient(90deg, #3377B6, #ffffff 85%); -webkit-background-clip: text; -webkit-text-fill-color: transparent;";
wEl.querySelector("em").innerHTML = wEl.querySelector("em").innerHTML + " &#x1F327;";
wEl.querySelector("em").innerHTML =
wEl.querySelector("em").innerHTML + " &#x1F327;";
case "Overcast":
wEl.querySelector("em").style =
"background: linear-gradient(to bottom, #666666, #ffffff 85%); -webkit-background-clip: text; -webkit-text-fill-color: transparent;";
Expand Down Expand Up @@ -158,11 +161,38 @@ const focus = (selector) => {
document.querySelector(selector).focus();
};

const stars = (user) =>
get(`https://api.github.com/users/${user}/starred`).then((data) => {
if (typeof data !== "undefined") {
console.log({ raw: data });
const starred = data.map((s) => ({
origin_user: s.owner.login,
origin_id: s.id,
origin_url: s.html_url,
origin_created_at: s.created_at,
content: s.description,
title: s.name,
tags: s.topics.concat(s.language),
meta: {
isFork: s.fork,
git_url: s.git_url,
ssh_url: s.ssh_url,
repo_name: s.name,
repo_full_name: s.full_name,
},
}));

console.log({ starred });
}
});

const handleLoaded = () => {
mimic(false);
ip(true);
weather(true);
// focus("#test");
//
window.stars = stars;
};

if (["complete", "loaded", "interactive"].indexOf(document.readyState) >= 0) {
Expand Down
2 changes: 1 addition & 1 deletion misc/vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"extensions.experimental.affinity": {
"asvetliakov.vscode-neovim": 1
},
"debug.console.fontFamily": "'JetBrainsMono Nerd Font', monospace",
"debug.console.fontFamily": "'JetBrainsMono Nerd Font Mono', monospace",
"diffEditor.renderSideBySide": false,
"editor.accessibilitySupport": "off",
"editor.bracketPairColorization.enabled": false,
Expand Down

0 comments on commit d5c9cca

Please sign in to comment.