mirror of
https://github.com/m-housh/dotfiles.git
synced 2026-02-14 06:12:34 +00:00
Adds mhlink script, which still needs some work and updates to nvim config, which fixes tmux-navigator mappings
This commit is contained in:
@@ -1,3 +1,6 @@
|
||||
-- Leader needs to be set before loading plugins
|
||||
vim.g.mapleader = " "
|
||||
vim.g.maplocalleader = " "
|
||||
|
||||
-- Common settings
|
||||
require('user.settings')
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"Comment.nvim": { "branch": "master", "commit": "0236521ea582747b58869cb72f70ccfa967d2e89" },
|
||||
"LuaSnip": { "branch": "master", "commit": "2c3a3a3e4fb503bf39efb61290ecfa8aae95f5eb" },
|
||||
"LuaSnip": { "branch": "master", "commit": "cdbf6f41381e5ee4810b4b09284b603d8f18365d" },
|
||||
"bufdelete.nvim": { "branch": "master", "commit": "07d1f8ba79dec59d42b975a4df1c732b2e4e37b4" },
|
||||
"cmp-buffer": { "branch": "main", "commit": "3022dbc9166796b644a841a02de8dd1cc1d311fa" },
|
||||
"cmp-calc": { "branch": "main", "commit": "ce91d14d2e7a8b3f6ad86d85e34d41c1ae6268d9" },
|
||||
@@ -14,7 +14,7 @@
|
||||
"friendly-snippets": { "branch": "main", "commit": "43727c2ff84240e55d4069ec3e6158d74cb534b6" },
|
||||
"go.nvim": { "branch": "master", "commit": "54387e506e597ab65a89baa1681429728f66ed71" },
|
||||
"guihua.lua": { "branch": "master", "commit": "5ad8dba19ce9b9fd8965598984dfdc9c119f97e4" },
|
||||
"lazy.nvim": { "branch": "main", "commit": "6b6f0a451200bb6abde85978c577c73ea1577758" },
|
||||
"lazy.nvim": { "branch": "main", "commit": "6687afae42b72fb660bfae2bd0eb98e77156829b" },
|
||||
"lazygit.nvim": { "branch": "main", "commit": "de35012036d43bca03628d40d083f7c02a4cda3f" },
|
||||
"lsp_signature.nvim": { "branch": "master", "commit": "bdf3dc7bb03edd25c2173e0e31c2fb122052ed23" },
|
||||
"lspkind-nvim": { "branch": "master", "commit": "57610d5ab560c073c465d6faf0c19f200cb67e6e" },
|
||||
|
||||
@@ -15,10 +15,10 @@ keymap('i', '<c-s>', '<ESC>:w<CR>a', default_options)
|
||||
keymap("v", "p", "\"_dP", default_options)
|
||||
|
||||
-- buffer focus
|
||||
keymap('n', '<c-j>', '<c-w>j', default_options)
|
||||
keymap('n', '<c-h>', '<c-w>h', default_options)
|
||||
keymap('n', '<c-k>', '<c-w>k', default_options)
|
||||
keymap('n', '<c-l>', '<c-w>l', default_options)
|
||||
-- keymap('n', '<c-j>', '<c-w>j', default_options)
|
||||
-- keymap('n', '<c-h>', '<c-w>h', default_options)
|
||||
-- keymap('n', '<c-k>', '<c-w>k', default_options)
|
||||
-- keymap('n', '<c-l>', '<c-w>l', default_options)
|
||||
|
||||
-- Resizing panes
|
||||
keymap("n", "<Left>", ":vertical resize +1<CR>", default_options)
|
||||
@@ -79,7 +79,8 @@ end, default_options)
|
||||
-- Find zsh config files.
|
||||
keymap('n', '<leader>fz', function()
|
||||
telescope.find_files({
|
||||
cwd='$HOME/.dotfiles/zsh/config'
|
||||
cwd = '$HOME/.dotfiles/zsh/config',
|
||||
hidden = true
|
||||
})
|
||||
end, default_options)
|
||||
|
||||
|
||||
43
scripts/scripts/mhlink
Executable file
43
scripts/scripts/mhlink
Executable file
@@ -0,0 +1,43 @@
|
||||
#!/usr/bin/env zsh
|
||||
|
||||
root=
|
||||
localOpt=
|
||||
|
||||
zparseopts -- \
|
||||
{l,-local}=localOpt
|
||||
|
||||
if [ -d "$HOME/projects/github.com/m-housh/mhoush.com" ]; then
|
||||
root="$HOME/projects/github.com/m-housh/mhoush.com"
|
||||
else
|
||||
root="$HOME/projects/mhoush.com"
|
||||
fi
|
||||
|
||||
postsPath="$root/content/posts"
|
||||
|
||||
# Abort early if the post path does not exist.
|
||||
[ ! -d $postsPath ] \
|
||||
&& echo "Could not find posts directory" \
|
||||
&& exit 1
|
||||
|
||||
posts=$(find "$postsPath" -mindepth 1 -maxdepth 1 -type d -print0 | \
|
||||
xargs -0 stat -f"%m %Sm %N" | \
|
||||
sort -rn
|
||||
)
|
||||
|
||||
choice=$(echo "$posts" | fzf)
|
||||
|
||||
[ -z $choice ] \
|
||||
&& echo "No selection made." \
|
||||
&& exit 1
|
||||
|
||||
# Delete everything before the last /
|
||||
choice="${choice##*/}"
|
||||
|
||||
prefix="https://mhoush.com"
|
||||
|
||||
if [ -n "$localOpt" ]; then
|
||||
prefix="http://localhost:1313"
|
||||
fi
|
||||
|
||||
echo "$prefix/$choice/"
|
||||
|
||||
Reference in New Issue
Block a user