mirror of
https://github.com/m-housh/dotfiles.git
synced 2026-02-14 06:12:34 +00:00
Compare commits
89 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 17bc6ef41b | |||
| 9a05bd20d8 | |||
| bc342d28c8 | |||
| 148916909a | |||
| f362789006 | |||
| 367cae9748 | |||
| 8e46610a7b | |||
| ff870c0f1b | |||
| d34059c34d | |||
| 016e4d459f | |||
| cead1bc85e | |||
| c296a1492f | |||
| 892966d27a | |||
| b53d239cd3 | |||
| cd95365149 | |||
| ba8a64a447 | |||
| d15d3b406f | |||
| 9cc99ff03d | |||
| d3a383102b | |||
| c1b1381f24 | |||
| 0f58b00f97 | |||
| 05b36efeea | |||
| 30ff7b7652 | |||
| a3c3ed1d23 | |||
|
|
0294c4e5bc | ||
|
|
be24adf2aa | ||
|
|
2b4ecf3939 | ||
|
|
ce99e7dd76 | ||
| 3fcb57d090 | |||
| 346ff30f4a | |||
| a8e8228696 | |||
| 2f6630b272 | |||
|
|
a328615cbf | ||
|
|
385c17811d | ||
| 92a4571bff | |||
| 3a5adc07ad | |||
|
|
fa02ac9889 | ||
|
|
e3ff780999 | ||
| 64b5e4b21c | |||
| 00749e3be7 | |||
|
|
7690713f46 | ||
|
|
5927ef7fb3 | ||
| e90c491a47 | |||
| f55eca41f0 | |||
| 6cb0744e92 | |||
|
|
5555c14327 | ||
|
|
353b669f27 | ||
|
|
f0a5d85dea | ||
| f643b45432 | |||
| 427fd1d063 | |||
| ca0c0b1ca0 | |||
|
|
19229a2b90 | ||
|
|
e8772df72e | ||
|
|
660ff7d94d | ||
|
|
7c5c642ae5 | ||
|
|
742f26a81c | ||
|
|
7f13161948 | ||
|
|
00c5e0cca6 | ||
|
|
c930fb7e7a | ||
| be0bb66e09 | |||
| 8d68b1033a | |||
| 4b37f8afcb | |||
|
|
fcf8c83beb | ||
|
|
0e77478075 | ||
| a8c4191d96 | |||
| 56cfaf4360 | |||
| 35a5cf15c5 | |||
| 3896bab4fb | |||
|
|
9acb92154a | ||
|
|
e519322fb2 | ||
| aa8e3847a2 | |||
| 2de739ec68 | |||
| 1d08232c52 | |||
| 607f1b20b9 | |||
|
|
cc6dd26184 | ||
|
|
220dddc930 | ||
| 966c050875 | |||
| 275baa228c | |||
|
|
437b4f5002 | ||
|
|
ab1a45d421 | ||
|
|
663673dfd3 | ||
|
|
7673963158 | ||
|
|
433c6cf59f | ||
|
|
8d396ff46f | ||
| 6204b5f7b3 | |||
| 26f78217f7 | |||
| 42827b7154 | |||
| e3dd7a80f6 | |||
|
|
5cbb1affd5 |
4
.gitignore
vendored
4
.gitignore
vendored
@@ -1,7 +1,5 @@
|
||||
**/.DS_Store
|
||||
**/Brewfile.lock.json
|
||||
**/plugins
|
||||
**/plugin
|
||||
**/.zcompdump*
|
||||
**/.zcompdump
|
||||
**/.zcompcache
|
||||
@@ -11,4 +9,4 @@
|
||||
**/completions/*
|
||||
**/.netrwhist
|
||||
**/.zshrc-local
|
||||
nvim/lazy-lock.json
|
||||
facebook-bot/config/*
|
||||
|
||||
82
.luarc.json
Normal file
82
.luarc.json
Normal file
@@ -0,0 +1,82 @@
|
||||
{
|
||||
"workspace.library": [
|
||||
"/Users/michael/.local/share/m-housh/lazy/neodev.nvim/types/stable",
|
||||
"/opt/homebrew/Cellar/neovim/0.9.2/share/nvim/runtime/lua",
|
||||
"/Users/michael/.local/share/m-housh/lazy/bufdelete.nvim/lua",
|
||||
"/Users/michael/.local/share/m-housh/lazy/diffview.nvim/lua",
|
||||
"/Users/michael/.local/share/m-housh/lazy/lsp_signature.nvim/lua",
|
||||
"/Users/michael/.local/share/m-housh/lazy/neo-tree.nvim/lua",
|
||||
"/Users/michael/.local/share/m-housh/lazy/neodev.nvim/lua",
|
||||
"/Users/michael/.local/share/m-housh/lazy/telescope-fzf-native.nvim/lua",
|
||||
"/Users/michael/.local/share/m-housh/lazy/nvim-lspconfig/lua",
|
||||
"/Users/michael/.local/share/m-housh/lazy/nvim-cmp/lua",
|
||||
"/Users/michael/.local/share/m-housh/lazy/nvim-treesitter-textobjects/lua",
|
||||
"/Users/michael/.local/share/m-housh/lazy/nui.nvim/lua",
|
||||
"/Users/michael/.local/share/m-housh/lazy/nightfox.nvim/lua",
|
||||
"/Users/michael/.local/share/m-housh/lazy/cmp-buffer/lua",
|
||||
"/Users/michael/.local/share/m-housh/lazy/cmp-path/lua",
|
||||
"/Users/michael/.local/share/m-housh/lazy/nvim-treesitter/lua",
|
||||
"/Users/michael/.local/share/m-housh/lazy/nvim-lsp-installer/lua",
|
||||
"/Users/michael/.local/share/m-housh/lazy/cmp-cmdline/lua",
|
||||
"/Users/michael/.local/share/m-housh/lazy/lazy.nvim/lua",
|
||||
"/Users/michael/.local/share/m-housh/lazy/cmp-spell/lua",
|
||||
"/Users/michael/.local/share/m-housh/lazy/wrapping.nvim/lua",
|
||||
"/Users/michael/.local/share/m-housh/lazy/cmp-calc/lua",
|
||||
"/Users/michael/.local/share/m-housh/lazy/which-key.nvim/lua",
|
||||
"/Users/michael/.local/share/m-housh/lazy/mason-lspconfig.nvim/lua",
|
||||
"/Users/michael/.local/share/m-housh/lazy/formatter.nvim/lua",
|
||||
"/Users/michael/.local/share/m-housh/lazy/cmp-nvim-lsp/lua",
|
||||
"/Users/michael/.local/share/m-housh/lazy/cmp-emoji/lua",
|
||||
"/Users/michael/.local/share/m-housh/lazy/nvim-web-devicons/lua",
|
||||
"/Users/michael/.local/share/m-housh/lazy/plenary.nvim/lua",
|
||||
"/Users/michael/.local/share/m-housh/lazy/neogit/lua",
|
||||
"/Users/michael/.local/share/m-housh/lazy/overseer.nvim/lua",
|
||||
"/Users/michael/.local/share/m-housh/lazy/lualine.nvim/lua",
|
||||
"/Users/michael/.local/share/m-housh/lazy/mason.nvim/lua",
|
||||
"/Users/michael/.local/share/m-housh/lazy/telescope.nvim/lua",
|
||||
"/Users/michael/.local/share/m-housh/lazy/lspkind-nvim/lua",
|
||||
"/Users/michael/.local/share/m-housh/lazy/swift.nvim/lua",
|
||||
"/Users/michael/.local/share/m-housh/lazy/toggleterm.nvim/lua",
|
||||
"/Users/michael/.local/share/m-housh/lazy/neodev.nvim/types/stable",
|
||||
"/opt/homebrew/Cellar/neovim/0.9.2/share/nvim/runtime/lua",
|
||||
"/Users/michael/.local/share/m-housh/lazy/bufdelete.nvim/lua",
|
||||
"/Users/michael/.local/share/m-housh/lazy/diffview.nvim/lua",
|
||||
"/Users/michael/.local/share/m-housh/lazy/lsp_signature.nvim/lua",
|
||||
"/Users/michael/.local/share/m-housh/lazy/neo-tree.nvim/lua",
|
||||
"/Users/michael/.local/share/m-housh/lazy/neodev.nvim/lua",
|
||||
"/Users/michael/.local/share/m-housh/lazy/telescope-fzf-native.nvim/lua",
|
||||
"/Users/michael/.local/share/m-housh/lazy/nvim-lspconfig/lua",
|
||||
"/Users/michael/.local/share/m-housh/lazy/nvim-cmp/lua",
|
||||
"/Users/michael/.local/share/m-housh/lazy/nvim-treesitter-textobjects/lua",
|
||||
"/Users/michael/.local/share/m-housh/lazy/nui.nvim/lua",
|
||||
"/Users/michael/.local/share/m-housh/lazy/nightfox.nvim/lua",
|
||||
"/Users/michael/.local/share/m-housh/lazy/cmp-buffer/lua",
|
||||
"/Users/michael/.local/share/m-housh/lazy/cmp-path/lua",
|
||||
"/Users/michael/.local/share/m-housh/lazy/nvim-treesitter/lua",
|
||||
"/Users/michael/.local/share/m-housh/lazy/nvim-lsp-installer/lua",
|
||||
"/Users/michael/.local/share/m-housh/lazy/cmp-cmdline/lua",
|
||||
"/Users/michael/.local/share/m-housh/lazy/lazy.nvim/lua",
|
||||
"/Users/michael/.local/share/m-housh/lazy/cmp-spell/lua",
|
||||
"/Users/michael/.local/share/m-housh/lazy/wrapping.nvim/lua",
|
||||
"/Users/michael/.local/share/m-housh/lazy/cmp-calc/lua",
|
||||
"/Users/michael/.local/share/m-housh/lazy/which-key.nvim/lua",
|
||||
"/Users/michael/.local/share/m-housh/lazy/mason-lspconfig.nvim/lua",
|
||||
"/Users/michael/.local/share/m-housh/lazy/formatter.nvim/lua",
|
||||
"/Users/michael/.local/share/m-housh/lazy/cmp-nvim-lsp/lua",
|
||||
"/Users/michael/.local/share/m-housh/lazy/cmp-emoji/lua",
|
||||
"/Users/michael/.local/share/m-housh/lazy/nvim-web-devicons/lua",
|
||||
"/Users/michael/.local/share/m-housh/lazy/plenary.nvim/lua",
|
||||
"/Users/michael/.local/share/m-housh/lazy/neogit/lua",
|
||||
"/Users/michael/.local/share/m-housh/lazy/overseer.nvim/lua",
|
||||
"/Users/michael/.local/share/m-housh/lazy/lualine.nvim/lua",
|
||||
"/Users/michael/.local/share/m-housh/lazy/mason.nvim/lua",
|
||||
"/Users/michael/.local/share/m-housh/lazy/telescope.nvim/lua",
|
||||
"/Users/michael/.local/share/m-housh/lazy/lspkind-nvim/lua",
|
||||
"/Users/michael/.local/share/m-housh/lazy/swift.nvim/lua",
|
||||
"/Users/michael/.local/share/m-housh/lazy/toggleterm.nvim/lua",
|
||||
"/Users/michael/.dotfiles/nvim/m-housh/lua",
|
||||
"/Users/michael/.dotfiles/nvim/m-housh/lua",
|
||||
"${3rd}/luv/library",
|
||||
"${3rd}/luassert/library"
|
||||
]
|
||||
}
|
||||
6
TODO.md
6
TODO.md
@@ -1,4 +1,6 @@
|
||||
# TODO
|
||||
|
||||
- Remove brewfiles and use the `dots` app instead.
|
||||
- Add helix to `dots` app.
|
||||
- Add zsh functions to dots cli manager.
|
||||
- Add tmux plugins to dots cli manager.
|
||||
- Add tmux-powerline linking to `dots` cli manager.
|
||||
- Clean up zet commands, maybe make a gum / fzf filter script.
|
||||
|
||||
@@ -12,5 +12,6 @@ imports:
|
||||
- "./email.yml"
|
||||
- "./housecallpro.yml"
|
||||
- "./links.yml"
|
||||
- './symbols.yml'
|
||||
|
||||
|
||||
|
||||
9
espanso/espanso/match/symbols.yml
Normal file
9
espanso/espanso/match/symbols.yml
Normal file
@@ -0,0 +1,9 @@
|
||||
matches:
|
||||
- trigger: ':deg:'
|
||||
replace: '°'
|
||||
- trigger: ':cmd:'
|
||||
replace: '⌘'
|
||||
- trigger: ':shift:'
|
||||
replace: '⇧'
|
||||
- trigger: ':noteq:'
|
||||
replace: '≠'
|
||||
11
facebook-bot/README.md
Normal file
11
facebook-bot/README.md
Normal file
@@ -0,0 +1,11 @@
|
||||
# Facebook Bot Instructions
|
||||
|
||||
This is used to programmaticly make posts to Facebook.
|
||||
|
||||
## References
|
||||
|
||||
- https://developers.facebook.com/docs/graph-api/reference/v18.0/group/feed
|
||||
- https://developers.facebook.com/tools/explorer?method=GET&path=896542914538874&version=v18.0
|
||||
|
||||
An access token with `publish_to_groups` permissions is required to post to
|
||||
groups.
|
||||
17
kitty/kitty.conf
Normal file
17
kitty/kitty.conf
Normal file
@@ -0,0 +1,17 @@
|
||||
# _ _ _ ___ ___ _ _ ____ ____ _ _ ____
|
||||
# |_/ | | | \_/ | | | |\ | |___
|
||||
# | \_ | | | | .|___ |__| | \| |
|
||||
#
|
||||
|
||||
font_family Droid Sans Mono for Powerline Regular
|
||||
|
||||
font_size 16.0
|
||||
symbol_map U+E0A0-U+E0A3,U+E0C0-U+E0C7 1
|
||||
narrow_symbols U+E0A0-U+E0A3,U+E0C0-U+E0C7 1
|
||||
|
||||
macos_titlebar_color system
|
||||
|
||||
background_opacity 0.9
|
||||
|
||||
#hide_window_decorations titlebar-only
|
||||
hide_window_decorations no
|
||||
@@ -663,6 +663,8 @@
|
||||
<false/>
|
||||
<key>OpenNoWindowsAtStartup</key>
|
||||
<false/>
|
||||
<key>OpenTmuxWindowsIn</key>
|
||||
<integer>0</integer>
|
||||
<key>PointerActions</key>
|
||||
<dict>
|
||||
<key>Button,1,1,,</key>
|
||||
|
||||
@@ -6,9 +6,9 @@
|
||||
<string>com.micheal.clear-screenshots</string>
|
||||
<key>ProgramArguments</key>
|
||||
<array>
|
||||
<string>sh</string>
|
||||
<string>zsh</string>
|
||||
<string>-c</string>
|
||||
<string>/Users/michael/.local/scripts/clear_screenshots</string>
|
||||
<string>/Users/michael/.config/zsh/functions/clean-screenshots</string>
|
||||
</array>
|
||||
<key>StartCalendarInterval</key>
|
||||
<dict>
|
||||
|
||||
17
nap/config.yaml
Normal file
17
nap/config.yaml
Normal file
@@ -0,0 +1,17 @@
|
||||
# Configuration
|
||||
home: ~/.local/nap
|
||||
default_language: go
|
||||
theme: nord
|
||||
|
||||
# Colors
|
||||
background: "0"
|
||||
foreground: "7"
|
||||
primary_color: "#AFBEE1"
|
||||
primary_color_subdued: "#64708D"
|
||||
green: "#527251"
|
||||
bright_green: "#BCE1AF"
|
||||
bright_red: "#E49393"
|
||||
red: "#A46060"
|
||||
black: "#373B41"
|
||||
gray: "240"
|
||||
white: "#FFFFFF"
|
||||
5
npm/npmrc
Normal file
5
npm/npmrc
Normal file
@@ -0,0 +1,5 @@
|
||||
# Needs linked to ~/.config/npm/npmrc
|
||||
|
||||
prefix=${XDG_DATA_HOME}/npm
|
||||
cache=${XDG_CACHE_HOME}/npm
|
||||
init-module=${XDG_CONFIG_HOME}/npm/config/npm-init.js
|
||||
@@ -1,11 +0,0 @@
|
||||
local o = vim.opt
|
||||
local keymap = vim.api.nvim_set_keymap
|
||||
local default_options = {noremap = true, silent = true}
|
||||
|
||||
o.tabstop = 2
|
||||
o.softtabstop = 2
|
||||
o.shiftwidth = 2
|
||||
|
||||
keymap('n', '<C-b>', '<cmd>!swift build<CR>', default_options)
|
||||
keymap('n', '<C-T>', '<cmd>!swift test<CR>', default_options)
|
||||
|
||||
@@ -1,14 +0,0 @@
|
||||
|
||||
require('plugins')
|
||||
|
||||
-- Key maps
|
||||
require('mappings')
|
||||
|
||||
-- Common settings
|
||||
require('settings')
|
||||
|
||||
-- Auto commands
|
||||
require('autocmd')
|
||||
|
||||
-- Theme
|
||||
require('theme')
|
||||
@@ -1,16 +0,0 @@
|
||||
-- Remove all trailing whitespace on save
|
||||
vim.api.nvim_exec([[
|
||||
augroup TrimWhiteSpace
|
||||
au!
|
||||
autocmd BufWritePre * :%s/\s\+$//e
|
||||
augroup END
|
||||
]], false)
|
||||
|
||||
-- Prevent new line to also start with a comment
|
||||
vim.api.nvim_exec([[
|
||||
augroup NewLineComment
|
||||
au!
|
||||
au FileType * setlocal formatoptions-=c formatoptions-=r formatoptions-=o
|
||||
augroup END
|
||||
]], false)
|
||||
|
||||
@@ -1,32 +0,0 @@
|
||||
local keymap = vim.api.nvim_set_keymap
|
||||
local default_options = {noremap = true, silent = true}
|
||||
-- local expr_options = {noremap = true, expr = true, silent = true}
|
||||
|
||||
-- easier escape key mapping
|
||||
keymap('i', 'jk', '<ESC>', default_options)
|
||||
|
||||
keymap('n', '<c-s>', ':w<CR>', default_options)
|
||||
keymap('i', '<c-s>', '<ESC>:w<CR>a', default_options)
|
||||
|
||||
-- paste over currently selected text without yanking it
|
||||
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)
|
||||
|
||||
-- Resizing panes
|
||||
keymap("n", "<Left>", ":vertical resize +1<CR>", default_options)
|
||||
keymap("n", "<Right>", ":vertical resize -1<CR>", default_options)
|
||||
keymap("n", "<Up>", ":resize -1<CR>", default_options)
|
||||
keymap("n", "<Down>", ":resize +1<CR>", default_options)
|
||||
|
||||
-- Move selected line / block of text in visual mode
|
||||
keymap("x", "K", ":move '<-2<CR>gv-gv", default_options)
|
||||
keymap("x", "J", ":move '>+1<CR>gv-gv", default_options)
|
||||
|
||||
-- Toggle nvim-tree open or closed
|
||||
keymap("n", "<c-n>", "<CMD>:Neotree toggle<CR>", default_options)
|
||||
|
||||
@@ -1,48 +0,0 @@
|
||||
return {
|
||||
"sindrets/diffview.nvim",
|
||||
cmd = {
|
||||
"DiffviewOpen",
|
||||
"DiffviewClose",
|
||||
"DiffviewToggleFiles",
|
||||
"DiffviewFocusFiles"
|
||||
},
|
||||
config = function()
|
||||
local cb = require('diffview.config').diffview_callback
|
||||
|
||||
require('diffview').setup {
|
||||
diff_binaries = false, -- Show diffs for binaries
|
||||
use_icons = true, -- Requires nvim-web-devicons
|
||||
file_panel = {
|
||||
width = 35,
|
||||
},
|
||||
key_bindings = {
|
||||
disable_defaults = false, -- Disable the default key bindings
|
||||
-- The `view` bindings are active in the diff buffers, only when the current
|
||||
-- tabpage is a Diffview.
|
||||
view = {
|
||||
["<tab>"] = cb("select_next_entry"), -- Open the diff for the next file
|
||||
["<s-tab>"] = cb("select_prev_entry"), -- Open the diff for the previous file
|
||||
["<leader>e"] = cb("focus_files"), -- Bring focus to the files panel
|
||||
["<leader>b"] = cb("toggle_files"), -- Toggle the files panel.
|
||||
},
|
||||
file_panel = {
|
||||
["j"] = cb("next_entry"), -- Bring the cursor to the next file entry
|
||||
["<down>"] = cb("next_entry"),
|
||||
["k"] = cb("prev_entry"), -- Bring the cursor to the previous file entry.
|
||||
["<up>"] = cb("prev_entry"),
|
||||
["<cr>"] = cb("select_entry"), -- Open the diff for the selected entry.
|
||||
["o"] = cb("select_entry"),
|
||||
["<2-LeftMouse>"] = cb("select_entry"),
|
||||
["-"] = cb("toggle_stage_entry"), -- Stage / unstage the selected entry.
|
||||
["S"] = cb("stage_all"), -- Stage all entries.
|
||||
["U"] = cb("unstage_all"), -- Unstage all entries.
|
||||
["R"] = cb("refresh_files"), -- Update stats and entries in the file list.
|
||||
["<tab>"] = cb("select_next_entry"),
|
||||
["<s-tab>"] = cb("select_prev_entry"),
|
||||
["<leader>e"] = cb("focus_files"),
|
||||
["<leader>b"] = cb("toggle_files"),
|
||||
}
|
||||
}
|
||||
}
|
||||
end
|
||||
}
|
||||
@@ -1,9 +0,0 @@
|
||||
-- This file contains plugin's that don't require much configuration.
|
||||
return {
|
||||
{
|
||||
"hrsh7th/vim-vsnip",
|
||||
config = function()
|
||||
vim.g.vsnip_snippet_dir = os.getenv('HOME') .. '/.config/nvim/snippets/'
|
||||
end
|
||||
},
|
||||
}
|
||||
@@ -1,6 +0,0 @@
|
||||
return {
|
||||
"williamboman/nvim-lsp-installer",
|
||||
config = function()
|
||||
require("nvim-lsp-installer").setup()
|
||||
end
|
||||
}
|
||||
@@ -1,158 +0,0 @@
|
||||
return {
|
||||
"neovim/nvim-lspconfig",
|
||||
dependencies = {
|
||||
"hrsh7th/cmp-nvim-lsp",
|
||||
},
|
||||
config = function()
|
||||
require("mason").setup()
|
||||
require("mason-lspconfig").setup()
|
||||
local nvim_lsp = require("lspconfig")
|
||||
|
||||
-- Use an on_attach function to only map the following keys
|
||||
-- after the language server attaches to the current buffer
|
||||
local on_attach = function(bufnr)
|
||||
local function buf_set_keymap(...)
|
||||
vim.api.nvim_buf_set_keymap(bufnr, ...)
|
||||
end
|
||||
|
||||
-- Mappings.
|
||||
local opts = {noremap = true, silent = true}
|
||||
|
||||
-- See `:help vim.lsp.*` for documentation on any of the below functions
|
||||
buf_set_keymap("n", "gD", "<Cmd>lua vim.lsp.buf.declaration()<CR>", opts)
|
||||
buf_set_keymap("n", "gd", "<Cmd>lua vim.lsp.buf.definition()<CR>", opts)
|
||||
buf_set_keymap("n", "K", "<Cmd>lua vim.lsp.buf.hover()<CR>", opts)
|
||||
buf_set_keymap("n", "gi", "<cmd>lua vim.lsp.buf.implementation()<CR>", opts)
|
||||
buf_set_keymap("n", "gT", vim.lsp.buf.type_definition, opts)
|
||||
-- buf_set_keymap('n', '<C-k>', '<cmd>lua vim.lsp.buf.signature_help()<CR>', opts)
|
||||
buf_set_keymap("n", "<space>wa",
|
||||
"<cmd>lua vim.lsp.buf.add_workspace_folder()<CR>", opts)
|
||||
buf_set_keymap("n", "<space>wr",
|
||||
"<cmd>lua vim.lsp.buf.remove_workspace_folder()<CR>", opts)
|
||||
buf_set_keymap("n", "<space>wl",
|
||||
"<cmd>lua print(vim.inspect(vim.lsp.buf.list_workspace_folders()))<CR>",
|
||||
opts)
|
||||
buf_set_keymap("n", "<space>D",
|
||||
"<cmd>lua vim.lsp.buf.type_definition()<CR>", opts)
|
||||
buf_set_keymap("n", "<space>rn", "<cmd>lua vim.lsp.buf.rename()<CR>", opts)
|
||||
buf_set_keymap("n", "<space>ca", "<cmd>lua vim.lsp.buf.code_action()<CR>",
|
||||
opts)
|
||||
buf_set_keymap("n", "gr", "<cmd>lua vim.lsp.buf.references()<CR>", opts)
|
||||
buf_set_keymap("n", "<space>e", "<cmd>lua vim.lsp.diagnostic.show_line_diagnostics()<CR>", opts)
|
||||
buf_set_keymap("n", "[d", "<cmd>lua vim.lsp.diagnostic.goto_prev()<CR>", opts)
|
||||
|
||||
buf_set_keymap("n", "]d", "<cmd>lua vim.lsp.diagnostic.goto_next()<CR>", opts)
|
||||
buf_set_keymap("n", "<space>q", "<cmd>lua vim.lsp.diagnostic.set_loclist()<CR>", opts)
|
||||
buf_set_keymap("n", "<space>f", "<cmd>lua vim.lsp.buf.formatting()<CR>", opts)
|
||||
|
||||
end
|
||||
|
||||
-- Use a loop to conveniently call 'setup' on multiple servers and
|
||||
-- map buffer local keybindings when the language server attaches
|
||||
--local capabilities = vim.lsp.protocol.make_client_capabilities()
|
||||
capabilities = require("cmp_nvim_lsp").default_capabilities()
|
||||
|
||||
local servers = {
|
||||
"gopls", "bashls", "jedi_language_server", "dockerls", "terraformls",
|
||||
"tsserver", "texlab", "yamlls", "jsonls", "clangd", "sourcekit"
|
||||
}
|
||||
for _, lsp in ipairs(servers) do
|
||||
nvim_lsp[lsp].setup {
|
||||
on_attach = on_attach,
|
||||
capabilities = capabilities,
|
||||
settings = {
|
||||
gopls = {analyses = {unusedparams = false}, staticcheck = true},
|
||||
json = {
|
||||
format = {enabled = false},
|
||||
schemas = {
|
||||
{
|
||||
description = "ESLint config",
|
||||
fileMatch = {".eslintrc.json", ".eslintrc"},
|
||||
url = "http://json.schemastore.org/eslintrc"
|
||||
}, {
|
||||
description = "Package config",
|
||||
fileMatch = {"package.json"},
|
||||
url = "https://json.schemastore.org/package"
|
||||
}, {
|
||||
description = "Packer config",
|
||||
fileMatch = {"packer.json"},
|
||||
url = "https://json.schemastore.org/packer"
|
||||
}, {
|
||||
description = "Renovate config",
|
||||
fileMatch = {
|
||||
"renovate.json", "renovate.json5",
|
||||
".github/renovate.json", ".github/renovate.json5",
|
||||
".renovaterc", ".renovaterc.json"
|
||||
},
|
||||
url = "https://docs.renovatebot.com/renovate-schema"
|
||||
}, {
|
||||
description = "OpenApi config",
|
||||
fileMatch = {"*api*.json"},
|
||||
url = "https://raw.githubusercontent.com/OAI/OpenAPI-Specification/main/schemas/v3.1/schema.json"
|
||||
}
|
||||
}
|
||||
},
|
||||
redhat = {telemetry = {enabled = false}},
|
||||
texlab = {
|
||||
auxDirectory = ".",
|
||||
bibtexFormatter = "texlab",
|
||||
build = {
|
||||
args = {
|
||||
"--keep-intermediates", "--keep-logs", "--synctex", "%f"
|
||||
},
|
||||
executable = "tectonic",
|
||||
forwardSearchAfter = false,
|
||||
onSave = false
|
||||
},
|
||||
chktex = {onEdit = false, onOpenAndSave = false},
|
||||
diagnosticsDelay = 300,
|
||||
formatterLineLength = 80,
|
||||
forwardSearch = {args = {}},
|
||||
latexFormatter = "latexindent",
|
||||
latexindent = {modifyLineBreaks = false}
|
||||
},
|
||||
yaml = {
|
||||
schemaStore = {
|
||||
enable = true,
|
||||
url = "https://www.schemastore.org/api/json/catalog.json"
|
||||
},
|
||||
schemas = {
|
||||
kubernetes = "/*.yaml",
|
||||
["http://json.schemastore.org/github-workflow"] = ".github/workflows/*.{yml,yaml}",
|
||||
["http://json.schemastore.org/github-action"] = ".github/action.{yml,yaml}",
|
||||
["http://json.schemastore.org/ansible-stable-2.9"] = "roles/tasks/*.{yml,yaml}",
|
||||
["http://json.schemastore.org/prettierrc"] = ".prettierrc.{yml,yaml}",
|
||||
["http://json.schemastore.org/kustomization"] = "kustomization.{yml,yaml}",
|
||||
["http://json.schemastore.org/ansible-playbook"] = "*play*.{yml,yaml}",
|
||||
["http://json.schemastore.org/chart"] = "Chart.{yml,yaml}",
|
||||
["https://json.schemastore.org/dependabot-v2"] = ".github/dependabot.{yml,yaml}",
|
||||
["https://json.schemastore.org/gitlab-ci"] = "*gitlab-ci*.{yml,yaml}",
|
||||
["https://raw.githubusercontent.com/OAI/OpenAPI-Specification/main/schemas/v3.1/schema.json"] = "*api*.{yml,yaml}",
|
||||
["https://raw.githubusercontent.com/compose-spec/compose-spec/master/schema/compose-spec.json"] = "docker-compose.{yml,yaml}",
|
||||
["https://raw.githubusercontent.com/argoproj/argo-workflows/master/api/jsonschema/schema.json"] = "*flow*.{yml,yaml}"
|
||||
},
|
||||
format = {enabled = false},
|
||||
validate = false, -- TODO: conflicts between Kubernetes resources and kustomization.yaml
|
||||
completion = true,
|
||||
hover = true
|
||||
}
|
||||
},
|
||||
flags = {debounce_text_changes = 150}
|
||||
}
|
||||
require"lsp_signature".setup({
|
||||
bind = true, -- This is mandatory, otherwise border config won't get registered.
|
||||
floating_window = true, -- show hint in a floating window, set to false for virtual text only mode
|
||||
doc_lines = 2, -- Set to 0 for not showing doc
|
||||
hint_prefix = "🐼 ",
|
||||
-- use_lspsaga = false, -- set to true if you want to use lspsaga popup
|
||||
handler_opts = {
|
||||
border = "shadow" -- double, single, shadow, none
|
||||
}
|
||||
})
|
||||
end
|
||||
|
||||
-- Test source-kit
|
||||
require('lspconfig').sourcekit.setup{}
|
||||
|
||||
end
|
||||
}
|
||||
@@ -1,25 +0,0 @@
|
||||
return {
|
||||
"williamboman/mason-lspconfig.nvim",
|
||||
dependencies = {
|
||||
"williamboman/mason.nvim",
|
||||
"onsails/lspkind-nvim",
|
||||
"famiu/bufdelete.nvim",
|
||||
"ray-x/lsp_signature.nvim",
|
||||
"neovim/nvim-lspconfig"
|
||||
},
|
||||
opts = {
|
||||
ensure_installed = {
|
||||
"bashls",
|
||||
"clangd",
|
||||
"dockerls",
|
||||
"gopls",
|
||||
"jsonls",
|
||||
"jedi_language_server",
|
||||
"lua_ls",
|
||||
"terraformls",
|
||||
"tsserver",
|
||||
"texlab",
|
||||
"yamlls",
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,16 +0,0 @@
|
||||
return {
|
||||
"nvim-neo-tree/neo-tree.nvim",
|
||||
branch = "v3.x",
|
||||
dependencies = {
|
||||
"nvim-lua/plenary.nvim",
|
||||
"nvim-tree/nvim-web-devicons", -- not strictly required, but recommended
|
||||
"MunifTanjim/nui.nvim",
|
||||
},
|
||||
config = function()
|
||||
require("neo-tree").setup({
|
||||
close_if_last_window = false,
|
||||
enable_git_status = true,
|
||||
enable_diagnostics = true
|
||||
})
|
||||
end
|
||||
}
|
||||
@@ -1,38 +0,0 @@
|
||||
return {
|
||||
"TimUntersberger/neogit",
|
||||
dependencies = {
|
||||
"nvim-lua/plenary.nvim",
|
||||
"nvim-telescope/telescope.nvim", -- optional
|
||||
"sindrets/diffview.nvim", -- optional
|
||||
},
|
||||
opts = {
|
||||
disable_signs = false,
|
||||
disable_context_highlighting = false,
|
||||
disable_commit_confirmation = true,
|
||||
-- customize displayed signs
|
||||
signs = {
|
||||
-- { CLOSED, OPENED }
|
||||
section = { ">", "v" },
|
||||
item = { ">", "v" },
|
||||
hunk = { "", "" },
|
||||
},
|
||||
integrations = {
|
||||
diffview = true
|
||||
},
|
||||
-- override/add mappings
|
||||
mappings = {
|
||||
-- modify status buffer mappings
|
||||
status = {
|
||||
-- Adds a mapping with "B" as key that does the "BranchPopup" command
|
||||
["B"] = "BranchPopup",
|
||||
["C"] = "CommitPopup",
|
||||
-- ["P"] = "PullPopup",
|
||||
["S"] = "Stage",
|
||||
-- ["D"] = "Discard",
|
||||
-- Removes the default mapping of "s"
|
||||
-- ["s"] = "",
|
||||
}
|
||||
}
|
||||
},
|
||||
cmd = "Neogit",
|
||||
}
|
||||
@@ -1,29 +0,0 @@
|
||||
return {
|
||||
'EdenEast/nightfox.nvim',
|
||||
lazy = false, -- make sure we load this during startup
|
||||
priority = 1000, -- make sure to load this before all other plugins.
|
||||
opts = {
|
||||
fox = "terafox", -- change the colorscheme to use terafox
|
||||
styles = {
|
||||
comments = "italic", -- change style of comments to be italic
|
||||
keywords = "bold", -- change style of keywords to be bold
|
||||
functions = "italic,bold" -- styles can be a comma separated list
|
||||
},
|
||||
inverse = {
|
||||
match_paren = true, -- inverse the highlighting of match_parens
|
||||
},
|
||||
colors = {
|
||||
red = "#FF000", -- Override the red color for MAX POWER
|
||||
--bg_alt = "#000000",
|
||||
},
|
||||
hlgroups = {
|
||||
TSPunctDelimiter = { fg = "${red}" }, -- Override a highlight group with the color red
|
||||
LspCodeLens = { bg = "#000000", style = "italic" },
|
||||
}
|
||||
|
||||
},
|
||||
config = function()
|
||||
require('nightfox').load()
|
||||
vim.cmd("colorscheme terafox")
|
||||
end
|
||||
}
|
||||
@@ -1,118 +0,0 @@
|
||||
-- Setup nvim-cmp.
|
||||
local cmp = require "cmp"
|
||||
local lspkind = require("lspkind")
|
||||
local capabilities = require('cmp_nvim_lsp').default_capabilities()
|
||||
|
||||
local has_words_before = function()
|
||||
local line, col = unpack(vim.api.nvim_win_get_cursor(0))
|
||||
return col ~= 0
|
||||
and vim.api.nvim_buf_get_lines(0, line - 1, line, true)[1]:sub(
|
||||
col, col):match("%s") == nil
|
||||
end
|
||||
|
||||
local feedkey = function(key, mode)
|
||||
vim.api.nvim_feedkeys(vim.api.nvim_replace_termcodes(key, true, true, true),
|
||||
mode, true)
|
||||
end
|
||||
|
||||
|
||||
require'lspconfig'.sourcekit.setup {
|
||||
capabilities = capabilities
|
||||
}
|
||||
|
||||
lspkind.init({
|
||||
symbol_map = {
|
||||
Text = "",
|
||||
Method = "",
|
||||
Function = "",
|
||||
Constructor = "",
|
||||
Field = "ﰠ",
|
||||
Variable = "",
|
||||
Class = "ﴯ",
|
||||
Interface = "",
|
||||
Module = "",
|
||||
Property = "ﰠ",
|
||||
Unit = "塞",
|
||||
Value = "",
|
||||
Enum = "",
|
||||
Keyword = "",
|
||||
Snippet = "",
|
||||
Color = "",
|
||||
File = "",
|
||||
Reference = "",
|
||||
Folder = "",
|
||||
EnumMember = "",
|
||||
Constant = "",
|
||||
Struct = "פּ",
|
||||
Event = "",
|
||||
Operator = "",
|
||||
TypeParameter = ""
|
||||
}
|
||||
})
|
||||
|
||||
cmp.setup({
|
||||
formatting = {
|
||||
format = lspkind.cmp_format {
|
||||
with_text = false,
|
||||
maxwidth = 50,
|
||||
menu = {
|
||||
buffer = "BUF",
|
||||
nvim_lsp = "LSP",
|
||||
path = "PATH",
|
||||
vsnip = "SNIP",
|
||||
calc = "CALC",
|
||||
spell = "SPELL",
|
||||
emoji = "EMOJI"
|
||||
}
|
||||
}
|
||||
},
|
||||
experimental = {native_menu = false, ghost_text = false},
|
||||
snippet = {
|
||||
expand = function(args)
|
||||
vim.fn["vsnip#anonymous"](args.body) -- For `vsnip` users.
|
||||
end
|
||||
},
|
||||
mapping = {
|
||||
["<C-p>"] = cmp.mapping.select_prev_item(),
|
||||
["<C-n>"] = cmp.mapping.select_next_item(),
|
||||
["<C-d>"] = cmp.mapping.scroll_docs(-4),
|
||||
["<C-f>"] = cmp.mapping.scroll_docs(4),
|
||||
["<C-Space>"] = cmp.mapping.complete(),
|
||||
["<C-e>"] = cmp.mapping.close(),
|
||||
["<CR>"] = cmp.mapping.confirm {
|
||||
behavior = cmp.ConfirmBehavior.Replace,
|
||||
select = false
|
||||
},
|
||||
["<Tab>"] = cmp.mapping(function(fallback)
|
||||
if cmp.visible() then
|
||||
cmp.select_next_item()
|
||||
elseif vim.fn["vsnip#available"](1) == 1 then
|
||||
feedkey("<Plug>(vsnip-expand-or-jump)", "")
|
||||
elseif has_words_before() then
|
||||
cmp.complete()
|
||||
else
|
||||
fallback() -- The fallback function sends a already mapped key. In this case, it's probably `<Tab>`.
|
||||
end
|
||||
end, {"i", "s"}),
|
||||
["<S-Tab>"] = cmp.mapping(function()
|
||||
if cmp.visible() then
|
||||
cmp.select_prev_item()
|
||||
elseif vim.fn["vsnip#jumpable"](-1) == 1 then
|
||||
feedkey("<Plug>(vsnip-jump-prev)", "")
|
||||
end
|
||||
end, {"i", "s"})
|
||||
},
|
||||
sources = {
|
||||
{name = "nvim_lsp"}, {name = "buffer", keyword_length = 5},
|
||||
{name = "vsnip"}, {name = "calc"}, {name = "emoji"}, {name = "spell"},
|
||||
{name = "path"}
|
||||
}
|
||||
})
|
||||
|
||||
-- Use buffer source for `/`.
|
||||
cmp.setup.cmdline("/", {sources = {{name = "buffer"}}})
|
||||
|
||||
-- Use cmdline & path source for ':'.
|
||||
cmp.setup.cmdline(":", {
|
||||
sources = cmp.config.sources({{name = "path"}}, {{name = "cmdline"}})
|
||||
})
|
||||
@@ -1,15 +0,0 @@
|
||||
require'colorizer'.setup()
|
||||
local status_ok, colorizer = pcall(require, "colorizer")
|
||||
if not status_ok then
|
||||
return
|
||||
end
|
||||
colorizer.setup({ "*" }, {
|
||||
RGB = true, -- #RGB hex codes
|
||||
RRGGBB = true, -- #RRGGBB hex codes
|
||||
RRGGBBAA = true, -- #RRGGBBAA hex codes
|
||||
rgb_fn = true, -- CSS rgb() and rgba() functions
|
||||
hsl_fn = true, -- CSS hsl() and hsla() functions
|
||||
css = true, -- Enable all CSS features: rgb_fn, hsl_fn, names, RGB, RRGGBB
|
||||
css_fn = true, -- Enable all CSS *functions*: rgb_fn, hsl_fn
|
||||
namess = true, -- "Name" codes like Blue
|
||||
})
|
||||
@@ -1,37 +0,0 @@
|
||||
local cb = require'diffview.config'.diffview_callback
|
||||
|
||||
require'diffview'.setup {
|
||||
diff_binaries = false, -- Show diffs for binaries
|
||||
use_icons = true, -- Requires nvim-web-devicons
|
||||
file_panel = {
|
||||
width = 35,
|
||||
},
|
||||
key_bindings = {
|
||||
disable_defaults = false, -- Disable the default key bindings
|
||||
-- The `view` bindings are active in the diff buffers, only when the current
|
||||
-- tabpage is a Diffview.
|
||||
view = {
|
||||
["<tab>"] = cb("select_next_entry"), -- Open the diff for the next file
|
||||
["<s-tab>"] = cb("select_prev_entry"), -- Open the diff for the previous file
|
||||
["<leader>e"] = cb("focus_files"), -- Bring focus to the files panel
|
||||
["<leader>b"] = cb("toggle_files"), -- Toggle the files panel.
|
||||
},
|
||||
file_panel = {
|
||||
["j"] = cb("next_entry"), -- Bring the cursor to the next file entry
|
||||
["<down>"] = cb("next_entry"),
|
||||
["k"] = cb("prev_entry"), -- Bring the cursor to the previous file entry.
|
||||
["<up>"] = cb("prev_entry"),
|
||||
["<cr>"] = cb("select_entry"), -- Open the diff for the selected entry.
|
||||
["o"] = cb("select_entry"),
|
||||
["<2-LeftMouse>"] = cb("select_entry"),
|
||||
["-"] = cb("toggle_stage_entry"), -- Stage / unstage the selected entry.
|
||||
["S"] = cb("stage_all"), -- Stage all entries.
|
||||
["U"] = cb("unstage_all"), -- Unstage all entries.
|
||||
["R"] = cb("refresh_files"), -- Update stats and entries in the file list.
|
||||
["<tab>"] = cb("select_next_entry"),
|
||||
["<s-tab>"] = cb("select_prev_entry"),
|
||||
["<leader>e"] = cb("focus_files"),
|
||||
["<leader>b"] = cb("toggle_files"),
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,16 +0,0 @@
|
||||
local lsp_installer = require("nvim-lsp-installer")
|
||||
|
||||
-- Register a handler that will be called for all installed servers.
|
||||
-- Alternatively, you may also register handlers on specific server instances instead (see example below).
|
||||
lsp_installer.on_server_ready(function(server)
|
||||
local opts = {}
|
||||
|
||||
-- (optional) Customize the options passed to the server
|
||||
-- if server.name == "tsserver" then
|
||||
-- opts.root_dir = function() ... end
|
||||
-- end
|
||||
|
||||
-- This setup() function is exactly the same as lspconfig's setup function.
|
||||
-- Refer to https://github.com/neovim/nvim-lspconfig/blob/master/doc/server_configurations.md
|
||||
server:setup(opts)
|
||||
end)
|
||||
@@ -1,150 +0,0 @@
|
||||
require("mason").setup()
|
||||
require("mason-lspconfig").setup()
|
||||
local nvim_lsp = require("lspconfig")
|
||||
|
||||
-- Use an on_attach function to only map the following keys
|
||||
-- after the language server attaches to the current buffer
|
||||
local on_attach = function(bufnr)
|
||||
local function buf_set_keymap(...)
|
||||
vim.api.nvim_buf_set_keymap(bufnr, ...)
|
||||
end
|
||||
|
||||
-- Mappings.
|
||||
local opts = {noremap = true, silent = true}
|
||||
|
||||
-- See `:help vim.lsp.*` for documentation on any of the below functions
|
||||
buf_set_keymap("n", "gD", "<Cmd>lua vim.lsp.buf.declaration()<CR>", opts)
|
||||
buf_set_keymap("n", "gd", "<Cmd>lua vim.lsp.buf.definition()<CR>", opts)
|
||||
buf_set_keymap("n", "K", "<Cmd>lua vim.lsp.buf.hover()<CR>", opts)
|
||||
buf_set_keymap("n", "gi", "<cmd>lua vim.lsp.buf.implementation()<CR>", opts)
|
||||
buf_set_keymap("n", "gT", vim.lsp.buf.type_definition, opts)
|
||||
-- buf_set_keymap('n', '<C-k>', '<cmd>lua vim.lsp.buf.signature_help()<CR>', opts)
|
||||
buf_set_keymap("n", "<space>wa",
|
||||
"<cmd>lua vim.lsp.buf.add_workspace_folder()<CR>", opts)
|
||||
buf_set_keymap("n", "<space>wr",
|
||||
"<cmd>lua vim.lsp.buf.remove_workspace_folder()<CR>", opts)
|
||||
buf_set_keymap("n", "<space>wl",
|
||||
"<cmd>lua print(vim.inspect(vim.lsp.buf.list_workspace_folders()))<CR>",
|
||||
opts)
|
||||
buf_set_keymap("n", "<space>D",
|
||||
"<cmd>lua vim.lsp.buf.type_definition()<CR>", opts)
|
||||
buf_set_keymap("n", "<space>rn", "<cmd>lua vim.lsp.buf.rename()<CR>", opts)
|
||||
buf_set_keymap("n", "<space>ca", "<cmd>lua vim.lsp.buf.code_action()<CR>",
|
||||
opts)
|
||||
buf_set_keymap("n", "gr", "<cmd>lua vim.lsp.buf.references()<CR>", opts)
|
||||
buf_set_keymap("n", "<space>e", "<cmd>lua vim.lsp.diagnostic.show_line_diagnostics()<CR>", opts)
|
||||
buf_set_keymap("n", "[d", "<cmd>lua vim.lsp.diagnostic.goto_prev()<CR>", opts)
|
||||
|
||||
buf_set_keymap("n", "]d", "<cmd>lua vim.lsp.diagnostic.goto_next()<CR>", opts)
|
||||
buf_set_keymap("n", "<space>q", "<cmd>lua vim.lsp.diagnostic.set_loclist()<CR>", opts)
|
||||
buf_set_keymap("n", "<space>f", "<cmd>lua vim.lsp.buf.formatting()<CR>", opts)
|
||||
|
||||
end
|
||||
|
||||
-- Use a loop to conveniently call 'setup' on multiple servers and
|
||||
-- map buffer local keybindings when the language server attaches
|
||||
--local capabilities = vim.lsp.protocol.make_client_capabilities()
|
||||
capabilities = require("cmp_nvim_lsp").default_capabilities()
|
||||
|
||||
local servers = {
|
||||
"gopls", "bashls", "jedi_language_server", "dockerls", "terraformls",
|
||||
"tsserver", "texlab", "yamlls", "jsonls", "clangd", "sourcekit"
|
||||
}
|
||||
for _, lsp in ipairs(servers) do
|
||||
nvim_lsp[lsp].setup {
|
||||
on_attach = on_attach,
|
||||
capabilities = capabilities,
|
||||
settings = {
|
||||
gopls = {analyses = {unusedparams = false}, staticcheck = true},
|
||||
json = {
|
||||
format = {enabled = false},
|
||||
schemas = {
|
||||
{
|
||||
description = "ESLint config",
|
||||
fileMatch = {".eslintrc.json", ".eslintrc"},
|
||||
url = "http://json.schemastore.org/eslintrc"
|
||||
}, {
|
||||
description = "Package config",
|
||||
fileMatch = {"package.json"},
|
||||
url = "https://json.schemastore.org/package"
|
||||
}, {
|
||||
description = "Packer config",
|
||||
fileMatch = {"packer.json"},
|
||||
url = "https://json.schemastore.org/packer"
|
||||
}, {
|
||||
description = "Renovate config",
|
||||
fileMatch = {
|
||||
"renovate.json", "renovate.json5",
|
||||
".github/renovate.json", ".github/renovate.json5",
|
||||
".renovaterc", ".renovaterc.json"
|
||||
},
|
||||
url = "https://docs.renovatebot.com/renovate-schema"
|
||||
}, {
|
||||
description = "OpenApi config",
|
||||
fileMatch = {"*api*.json"},
|
||||
url = "https://raw.githubusercontent.com/OAI/OpenAPI-Specification/main/schemas/v3.1/schema.json"
|
||||
}
|
||||
}
|
||||
},
|
||||
redhat = {telemetry = {enabled = false}},
|
||||
texlab = {
|
||||
auxDirectory = ".",
|
||||
bibtexFormatter = "texlab",
|
||||
build = {
|
||||
args = {
|
||||
"--keep-intermediates", "--keep-logs", "--synctex", "%f"
|
||||
},
|
||||
executable = "tectonic",
|
||||
forwardSearchAfter = false,
|
||||
onSave = false
|
||||
},
|
||||
chktex = {onEdit = false, onOpenAndSave = false},
|
||||
diagnosticsDelay = 300,
|
||||
formatterLineLength = 80,
|
||||
forwardSearch = {args = {}},
|
||||
latexFormatter = "latexindent",
|
||||
latexindent = {modifyLineBreaks = false}
|
||||
},
|
||||
yaml = {
|
||||
schemaStore = {
|
||||
enable = true,
|
||||
url = "https://www.schemastore.org/api/json/catalog.json"
|
||||
},
|
||||
schemas = {
|
||||
kubernetes = "/*.yaml",
|
||||
["http://json.schemastore.org/github-workflow"] = ".github/workflows/*.{yml,yaml}",
|
||||
["http://json.schemastore.org/github-action"] = ".github/action.{yml,yaml}",
|
||||
["http://json.schemastore.org/ansible-stable-2.9"] = "roles/tasks/*.{yml,yaml}",
|
||||
["http://json.schemastore.org/prettierrc"] = ".prettierrc.{yml,yaml}",
|
||||
["http://json.schemastore.org/kustomization"] = "kustomization.{yml,yaml}",
|
||||
["http://json.schemastore.org/ansible-playbook"] = "*play*.{yml,yaml}",
|
||||
["http://json.schemastore.org/chart"] = "Chart.{yml,yaml}",
|
||||
["https://json.schemastore.org/dependabot-v2"] = ".github/dependabot.{yml,yaml}",
|
||||
["https://json.schemastore.org/gitlab-ci"] = "*gitlab-ci*.{yml,yaml}",
|
||||
["https://raw.githubusercontent.com/OAI/OpenAPI-Specification/main/schemas/v3.1/schema.json"] = "*api*.{yml,yaml}",
|
||||
["https://raw.githubusercontent.com/compose-spec/compose-spec/master/schema/compose-spec.json"] = "docker-compose.{yml,yaml}",
|
||||
["https://raw.githubusercontent.com/argoproj/argo-workflows/master/api/jsonschema/schema.json"] = "*flow*.{yml,yaml}"
|
||||
},
|
||||
format = {enabled = false},
|
||||
validate = false, -- TODO: conflicts between Kubernetes resources and kustomization.yaml
|
||||
completion = true,
|
||||
hover = true
|
||||
}
|
||||
},
|
||||
flags = {debounce_text_changes = 150}
|
||||
}
|
||||
require"lsp_signature".setup({
|
||||
bind = true, -- This is mandatory, otherwise border config won't get registered.
|
||||
floating_window = true, -- show hint in a floating window, set to false for virtual text only mode
|
||||
doc_lines = 2, -- Set to 0 for not showing doc
|
||||
hint_prefix = "🐼 ",
|
||||
-- use_lspsaga = false, -- set to true if you want to use lspsaga popup
|
||||
handler_opts = {
|
||||
border = "shadow" -- double, single, shadow, none
|
||||
}
|
||||
})
|
||||
end
|
||||
|
||||
-- Test source-kit
|
||||
require'lspconfig'.sourcekit.setup{}
|
||||
|
||||
@@ -1,114 +0,0 @@
|
||||
local colors = {
|
||||
red = '#ca1243',
|
||||
grey = '#a0a1a7',
|
||||
black = '#383a42',
|
||||
white = '#f3f3f3',
|
||||
light_green = '#83a598',
|
||||
orange = '#fe8019',
|
||||
green = '#8ec07c',
|
||||
}
|
||||
|
||||
local empty = require('lualine.component'):extend()
|
||||
function empty:draw(default_highlight)
|
||||
self.status = ''
|
||||
self.applied_separator = ''
|
||||
self:apply_highlights(default_highlight)
|
||||
self:apply_section_separators()
|
||||
return self.status
|
||||
end
|
||||
|
||||
-- Put proper separators and gaps between components in sections
|
||||
local function process_sections(sections)
|
||||
for name, section in pairs(sections) do
|
||||
local left = name:sub(9, 10) < 'x'
|
||||
for pos = 1, name ~= 'lualine_z' and #section or #section - 1 do
|
||||
table.insert(section, pos * 2, { empty, color = { fg = colors.white, bg = colors.white } })
|
||||
end
|
||||
for id, comp in ipairs(section) do
|
||||
if type(comp) ~= 'table' then
|
||||
comp = { comp }
|
||||
section[id] = comp
|
||||
end
|
||||
comp.separator = left and { right = '' } or { left = '' }
|
||||
end
|
||||
end
|
||||
return sections
|
||||
end
|
||||
|
||||
local function search_result()
|
||||
if vim.v.hlsearch == 0 then
|
||||
return ''
|
||||
end
|
||||
local last_search = vim.fn.getreg '/'
|
||||
if not last_search or last_search == '' then
|
||||
return ''
|
||||
end
|
||||
local searchcount = vim.fn.searchcount { maxcount = 9999 }
|
||||
return last_search .. '(' .. searchcount.current .. '/' .. searchcount.total .. ')'
|
||||
end
|
||||
|
||||
local function modified()
|
||||
if vim.bo.modified then
|
||||
return '+'
|
||||
elseif vim.bo.modifiable == false or vim.bo.readonly == true then
|
||||
return '-'
|
||||
end
|
||||
return ''
|
||||
end
|
||||
|
||||
require('lualine').setup {
|
||||
options = {
|
||||
theme = 'auto',
|
||||
component_separators = '',
|
||||
section_separators = { left = '', right = '' },
|
||||
},
|
||||
sections = process_sections {
|
||||
lualine_a = { 'mode' },
|
||||
lualine_b = {
|
||||
'branch',
|
||||
'diff',
|
||||
{
|
||||
'diagnostics',
|
||||
source = { 'nvim' },
|
||||
sections = { 'error' },
|
||||
diagnostics_color = { error = { bg = colors.red, fg = colors.white } },
|
||||
},
|
||||
{
|
||||
'diagnostics',
|
||||
source = { 'nvim' },
|
||||
sections = { 'warn' },
|
||||
diagnostics_color = { warn = { bg = colors.orange, fg = colors.white } },
|
||||
},
|
||||
{ 'filename', file_status = false, path = 1 },
|
||||
{ modified, color = { bg = colors.red } },
|
||||
{
|
||||
'%w',
|
||||
cond = function()
|
||||
return vim.wo.previewwindow
|
||||
end,
|
||||
},
|
||||
{
|
||||
'%r',
|
||||
cond = function()
|
||||
return vim.bo.readonly
|
||||
end,
|
||||
},
|
||||
{
|
||||
'%q',
|
||||
cond = function()
|
||||
return vim.bo.buftype == 'quickfix'
|
||||
end,
|
||||
},
|
||||
},
|
||||
lualine_c = {},
|
||||
lualine_x = {},
|
||||
lualine_y = { search_result, 'filetype' },
|
||||
lualine_z = { '%l:%c', '%p%%/%L' },
|
||||
},
|
||||
inactive_sections = {
|
||||
lualine_c = { '%f %y %m' },
|
||||
lualine_x = {},
|
||||
},
|
||||
tabline = {},
|
||||
extensions = {"nvim-tree"}
|
||||
}
|
||||
@@ -1,32 +0,0 @@
|
||||
local neogit = require('neogit')
|
||||
--neogit.config.use_magit_keybindings()
|
||||
|
||||
neogit.setup {
|
||||
disable_signs = false,
|
||||
disable_context_highlighting = false,
|
||||
disable_commit_confirmation = true,
|
||||
-- customize displayed signs
|
||||
signs = {
|
||||
-- { CLOSED, OPENED }
|
||||
section = { ">", "v" },
|
||||
item = { ">", "v" },
|
||||
hunk = { "", "" },
|
||||
},
|
||||
integrations = {
|
||||
diffview = true
|
||||
},
|
||||
-- override/add mappings
|
||||
mappings = {
|
||||
-- modify status buffer mappings
|
||||
status = {
|
||||
-- Adds a mapping with "B" as key that does the "BranchPopup" command
|
||||
["B"] = "BranchPopup",
|
||||
["C"] = "CommitPopup",
|
||||
-- ["P"] = "PullPopup",
|
||||
["S"] = "Stage",
|
||||
-- ["D"] = "Discard",
|
||||
-- Removes the default mapping of "s"
|
||||
-- ["s"] = "",
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,27 +0,0 @@
|
||||
local nightfox = require('nightfox')
|
||||
|
||||
-- This function set the configuration of nightfox. If a value is not passed in the setup function
|
||||
-- it will be taken from the default configuration above
|
||||
nightfox.setup({
|
||||
fox = "terafox", -- change the colorscheme to use terafox
|
||||
styles = {
|
||||
comments = "italic", -- change style of comments to be italic
|
||||
keywords = "bold", -- change style of keywords to be bold
|
||||
functions = "italic,bold" -- styles can be a comma separated list
|
||||
},
|
||||
inverse = {
|
||||
match_paren = true, -- inverse the highlighting of match_parens
|
||||
},
|
||||
colors = {
|
||||
red = "#FF000", -- Override the red color for MAX POWER
|
||||
--bg_alt = "#000000",
|
||||
},
|
||||
hlgroups = {
|
||||
TSPunctDelimiter = { fg = "${red}" }, -- Override a highlight group with the color red
|
||||
LspCodeLens = { bg = "#000000", style = "italic" },
|
||||
}
|
||||
})
|
||||
|
||||
-- Load the configuration set above and apply the colorscheme
|
||||
nightfox.load()
|
||||
vim.cmd("colorscheme terafox")
|
||||
@@ -1,162 +0,0 @@
|
||||
local g = vim.g
|
||||
|
||||
g.nvim_tree_indent_markers = 1 -- 0 by default, this option shows indent markers when folders are open
|
||||
g.nvim_tree_git_hl = 1 -- 0 by default, will enable file highlight for git attributes (can be used without the icons).
|
||||
g.nvim_tree_highlight_opened_files = 1 -- 0 by default, will enable folder and file icon highlight for opened files/directories.
|
||||
g.nvim_tree_root_folder_modifier = ":~" -- This is the default. See :help filename-modifiers for more options
|
||||
g.nvim_tree_add_trailing = 1 -- 0 by default, append a trailing slash to folder names
|
||||
g.nvim_tree_group_empty = 1 -- 0 by default, compact folders that only contain a single folder into one node in the file tree
|
||||
g.nvim_tree_disable_window_picker = 1 -- 0 by default, will disable the window picker.
|
||||
g.nvim_tree_icon_padding = " " -- one space by default, used for rendering the space between the icon and the filename. Use with caution, it could break rendering if you set an empty string depending on your font.
|
||||
g.nvim_tree_symlink_arrow = " >> " -- defaults to ' ➛ '. used as a separator between symlinks' source and target.
|
||||
g.nvim_tree_respect_buf_cwd = 1 -- 0 by default, will change cwd of nvim-tree to that of new buffer's when opening nvim-tree.
|
||||
|
||||
g.nvim_tree_show_icons = {git = 1, folders = 1, files = 1, folder_arrows = 1}
|
||||
g.nvim_tree_icons = {
|
||||
default = "",
|
||||
symlink = "",
|
||||
git = {
|
||||
unstaged = "",
|
||||
staged = "S",
|
||||
unmerged = "",
|
||||
renamed = "➜",
|
||||
deleted = "",
|
||||
untracked = "U",
|
||||
ignored = "◌"
|
||||
},
|
||||
folder = {
|
||||
default = "",
|
||||
open = "",
|
||||
empty = "",
|
||||
empty_open = "",
|
||||
symlink = ""
|
||||
}
|
||||
}
|
||||
g.loaded_netrw = 1
|
||||
g.loaded_netrwPlugin = 1
|
||||
local tree_cb = require("nvim-tree.config").nvim_tree_callback
|
||||
|
||||
-- This function has been generated from your
|
||||
-- view.mappings.list
|
||||
-- view.mappings.custom_only
|
||||
-- remove_keymaps
|
||||
--
|
||||
-- You should add this function to your configuration and set on_attach = on_attach in the nvim-tree setup call.
|
||||
--
|
||||
-- Although care was taken to ensure correctness and completeness, your review is required.
|
||||
--
|
||||
-- Please check for the following issues in auto generated content:
|
||||
-- "Mappings removed" is as you expect
|
||||
-- "Mappings migrated" are correct
|
||||
--
|
||||
-- Please see https://github.com/nvim-tree/nvim-tree.lua/wiki/Migrating-To-on_attach for assistance in migrating.
|
||||
--
|
||||
|
||||
local function on_attach(bufnr)
|
||||
local api = require('nvim-tree.api')
|
||||
|
||||
local function opts(desc)
|
||||
return { desc = 'nvim-tree: ' .. desc, buffer = bufnr, noremap = true, silent = true, nowait = true }
|
||||
end
|
||||
|
||||
|
||||
-- Default mappings not inserted as:
|
||||
-- remove_keymaps = true
|
||||
-- OR
|
||||
-- view.mappings.custom_only = true
|
||||
|
||||
|
||||
-- Mappings migrated from view.mappings.list
|
||||
--
|
||||
-- You will need to insert "your code goes here" for any mappings with a custom action_cb
|
||||
vim.keymap.set('n', '<CR>', api.node.open.edit, opts('Open'))
|
||||
vim.keymap.set('n', 'o', api.node.open.edit, opts('Open'))
|
||||
vim.keymap.set('n', '<2-LeftMouse>', api.node.open.edit, opts('Open'))
|
||||
vim.keymap.set('n', '<2-RightMouse>', api.tree.change_root_to_node, opts('CD'))
|
||||
vim.keymap.set('n', '<C-]>', api.tree.change_root_to_node, opts('CD'))
|
||||
vim.keymap.set('n', '<C-v>', api.node.open.vertical, opts('Open: Vertical Split'))
|
||||
vim.keymap.set('n', '<C-s>', api.node.open.horizontal, opts('Open: Horizontal Split'))
|
||||
vim.keymap.set('n', '<C-t>', api.node.open.tab, opts('Open: New Tab'))
|
||||
vim.keymap.set('n', '<', api.node.navigate.sibling.prev, opts('Previous Sibling'))
|
||||
vim.keymap.set('n', '>', api.node.navigate.sibling.next, opts('Next Sibling'))
|
||||
vim.keymap.set('n', 'P', api.node.navigate.parent, opts('Parent Directory'))
|
||||
vim.keymap.set('n', '<BS>', api.node.navigate.parent_close, opts('Close Directory'))
|
||||
vim.keymap.set('n', '<S-CR>', api.node.navigate.parent_close, opts('Close Directory'))
|
||||
vim.keymap.set('n', '<Tab>', api.node.open.preview, opts('Open Preview'))
|
||||
vim.keymap.set('n', 'K', api.node.navigate.sibling.first, opts('First Sibling'))
|
||||
vim.keymap.set('n', 'J', api.node.navigate.sibling.last, opts('Last Sibling'))
|
||||
vim.keymap.set('n', 'H', api.tree.toggle_hidden_filter, opts('Toggle Dotfiles'))
|
||||
vim.keymap.set('n', 'R', api.tree.reload, opts('Refresh'))
|
||||
vim.keymap.set('n', 'a', api.fs.create, opts('Create'))
|
||||
vim.keymap.set('n', 'd', api.fs.remove, opts('Delete'))
|
||||
vim.keymap.set('n', 'r', api.fs.rename, opts('Rename'))
|
||||
vim.keymap.set('n', '<C-r>', api.fs.rename_sub, opts('Rename: Omit Filename'))
|
||||
vim.keymap.set('n', 'x', api.fs.cut, opts('Cut'))
|
||||
vim.keymap.set('n', 'c', api.fs.copy.node, opts('Copy'))
|
||||
vim.keymap.set('n', 'p', api.fs.paste, opts('Paste'))
|
||||
vim.keymap.set('n', 'y', api.fs.copy.filename, opts('Copy Name'))
|
||||
vim.keymap.set('n', 'Y', api.fs.copy.relative_path, opts('Copy Relative Path'))
|
||||
vim.keymap.set('n', 'gy', api.fs.copy.absolute_path, opts('Copy Absolute Path'))
|
||||
vim.keymap.set('n', '[c', api.node.navigate.git.prev, opts('Prev Git'))
|
||||
vim.keymap.set('n', ']c', api.node.navigate.git.next, opts('Next Git'))
|
||||
vim.keymap.set('n', '-', api.tree.change_root_to_parent, opts('Up'))
|
||||
vim.keymap.set('n', 's', api.node.run.system, opts('Run System'))
|
||||
vim.keymap.set('n', 'q', api.tree.close, opts('Close'))
|
||||
vim.keymap.set('n', 'g?', api.tree.toggle_help, opts('Help'))
|
||||
end
|
||||
|
||||
require("nvim-tree").setup {
|
||||
-- disables netrw completely
|
||||
disable_netrw = true,
|
||||
-- hijack netrw window on startup
|
||||
hijack_netrw = true,
|
||||
-- closes neovim automatically when the tree is the last **WINDOW** in the view
|
||||
--auto_close = true,
|
||||
-- opens the tree when changing/opening a new tab if the tree wasn't previously opened
|
||||
open_on_tab = true,
|
||||
-- hijack the cursor in the tree to put it at the start of the filename
|
||||
hijack_cursor = true,
|
||||
-- updates the root directory of the tree on `DirChanged` (when your run `:cd` usually)
|
||||
update_cwd = true,
|
||||
-- this option hides files and folders starting with a dot `.`
|
||||
--hide_dotfiles = true,
|
||||
-- show lsp diagnostics in the signcolumn
|
||||
diagnostics = {
|
||||
enable = true,
|
||||
icons = {hint = "", info = "", warning = "", error = ""}
|
||||
},
|
||||
git = {ignore = true},
|
||||
-- update the focused file on `BufEnter`, un-collapses the folders recursively until it finds the file
|
||||
update_focused_file = {
|
||||
-- enables the feature
|
||||
enable = true,
|
||||
-- update the root directory of the tree to the one of the folder containing the file if the file is not under the current root directory
|
||||
-- only relevant when `update_focused_file.enable` is true
|
||||
update_cwd = true,
|
||||
-- list of buffer names / filetypes that will not update the cwd if the file isn't found under the current root directory
|
||||
-- only relevant when `update_focused_file.update_cwd` is true and `update_focused_file.enable` is true
|
||||
ignore_list = {".git", "node_modules", ".cache"}
|
||||
},
|
||||
-- configuration options for the system open command (`s` in the tree by default)
|
||||
system_open = {
|
||||
-- the command to run this, leaving nil should work in most cases
|
||||
cmd = nil,
|
||||
-- the command arguments as a list
|
||||
args = {}
|
||||
},
|
||||
|
||||
trash = {cmd = "trash-put"},
|
||||
|
||||
view = {
|
||||
-- show line numbers in tree disabled
|
||||
number = false,
|
||||
relativenumber = false,
|
||||
-- width of the window, can be either a number (columns) or a string in `%`
|
||||
width = 30,
|
||||
-- side of the tree, can be one of 'left' | 'right' | 'top' | 'bottom'
|
||||
side = "left",
|
||||
-- if true the tree will resize itself after opening a file
|
||||
--auto_resize = true,
|
||||
},
|
||||
on_attach = on_attach
|
||||
}
|
||||
@@ -1,66 +0,0 @@
|
||||
local actions = require('telescope.actions')
|
||||
local telescope = require('telescope')
|
||||
|
||||
--telescope.load_extension('projects')
|
||||
telescope.load_extension('fzf')
|
||||
|
||||
telescope.setup{
|
||||
defaults = {
|
||||
file_ignore_patterns = {"node_modules", "%.jpg", "%.png"},
|
||||
vimgrep_arguments = {
|
||||
'rg',
|
||||
'--follow',
|
||||
'--color=never',
|
||||
'--no-heading',
|
||||
'--with-filename',
|
||||
'--line-number',
|
||||
'--column',
|
||||
'--smart-case'
|
||||
},
|
||||
mappings = {
|
||||
i = {
|
||||
-- Close on first esc instead of gonig to normal mode
|
||||
["<esc>"] = actions.close,
|
||||
["<A-q>"] = actions.send_selected_to_qflist,
|
||||
["<C-q>"] = actions.send_to_qflist,
|
||||
["<s-tab>"] = actions.toggle_selection + actions.move_selection_next,
|
||||
["<tab>"] = actions.toggle_selection + actions.move_selection_previous,
|
||||
},
|
||||
n = {
|
||||
["<s-tab>"] = actions.toggle_selection + actions.move_selection_next,
|
||||
["<tab>"] = actions.toggle_selection + actions.move_selection_previous,
|
||||
["<A-q>"] = actions.send_selected_to_qflist,
|
||||
["<C-q>"] = actions.send_to_qflist,
|
||||
},
|
||||
},
|
||||
prompt_prefix = " ",
|
||||
selection_caret = " ",
|
||||
entry_prefix = " ",
|
||||
initial_mode = "insert",
|
||||
selection_strategy = "reset",
|
||||
sorting_strategy = "descending",
|
||||
layout_strategy = "flex",
|
||||
layout_config = {
|
||||
width = 0.75,
|
||||
prompt_position = "bottom",
|
||||
preview_cutoff = 120,
|
||||
horizontal = { mirror = false },
|
||||
vertical = { mirror = true },
|
||||
},
|
||||
file_sorter = require'telescope.sorters'.get_fuzzy_file,
|
||||
generic_sorter = require'telescope.sorters'.get_generic_fuzzy_sorter,
|
||||
-- path_display = true, -- strange behaviour not showing the files in result window
|
||||
winblend = 0,
|
||||
border = {},
|
||||
borderchars = { '─', '│', '─', '│', '╭', '╮', '╯', '╰' },
|
||||
color_devicons = true,
|
||||
use_less = true,
|
||||
set_env = { ['COLORTERM'] = 'truecolor' }, -- default = nil,
|
||||
file_previewer = require'telescope.previewers'.vim_buffer_cat.new,
|
||||
grep_previewer = require'telescope.previewers'.vim_buffer_vimgrep.new,
|
||||
qflist_previewer = require'telescope.previewers'.vim_buffer_qflist.new,
|
||||
|
||||
-- Developer configurations: Not meant for general override
|
||||
buffer_previewer_maker = require'telescope.previewers'.buffer_previewer_maker
|
||||
}
|
||||
}
|
||||
@@ -1,47 +0,0 @@
|
||||
require"nvim-treesitter.configs".setup {
|
||||
ensure_installed = {
|
||||
"bash", "cmake", "dockerfile", "go", "hcl", "html", "java",
|
||||
"javascript", "json", "latex", "ledger", "lua", "python", "toml", "yaml"
|
||||
}, -- one of "all", "maintained" (parsers with maintainers), or a list of languages
|
||||
ignore_install = {}, -- List of parsers to ignore installing
|
||||
highlight = {
|
||||
enable = true, -- false will disable the whole extension
|
||||
disable = {} -- list of language that will be disabled
|
||||
},
|
||||
incremental_selection = {
|
||||
enable = true,
|
||||
keymaps = {
|
||||
init_selection = "<CR>",
|
||||
scope_incremental = "<CR>",
|
||||
node_incremental = "<TAB>",
|
||||
node_decremental = "<S-TAB>"
|
||||
}
|
||||
},
|
||||
indent = {enable = true},
|
||||
autopairs = {{enable = true}},
|
||||
textobjects = {
|
||||
select = {
|
||||
enable = true,
|
||||
-- Automatically jump forward to textobj, similar to targets.vim
|
||||
lookahead = true,
|
||||
keymaps = {
|
||||
-- You can use the capture groups defined in textobjects.scm
|
||||
["af"] = "@function.outer",
|
||||
["if"] = "@function.inner",
|
||||
["ac"] = "@class.outer",
|
||||
["ic"] = "@class.inner",
|
||||
["al"] = "@loop.outer",
|
||||
["il"] = "@loop.inner",
|
||||
["ib"] = "@block.inner",
|
||||
["ab"] = "@block.outer",
|
||||
["ir"] = "@parameter.inner",
|
||||
["ar"] = "@parameter.outer"
|
||||
}
|
||||
}
|
||||
},
|
||||
rainbow = {
|
||||
enable = true,
|
||||
extended_mode = true, -- Highlight also non-parentheses delimiters, boolean or table: lang -> boolean
|
||||
max_file_lines = 2000 -- Do not enable for files with more than specified lines
|
||||
}
|
||||
}
|
||||
@@ -1,2 +0,0 @@
|
||||
local g = vim.g
|
||||
g.vsnip_snippet_dir = os.getenv('HOME') .. '/.config/nvim/snippets/'
|
||||
@@ -1,111 +0,0 @@
|
||||
--isable v
|
||||
-- local presets = require("which-key.plugins.presets")
|
||||
-- presets.operators["v"] = nil
|
||||
require("which-key").setup {
|
||||
plugins = {
|
||||
marks = true, -- shows a list of your marks on ' and `
|
||||
registers = true, -- shows your registers on " in NORMAL or <C-r> in INSERT mode
|
||||
spelling = {
|
||||
enabled = true, -- enabling this will show WhichKey when pressing z= to select spelling suggestions
|
||||
suggestions = 20 -- how many suggestions should be shown in the list?
|
||||
},
|
||||
-- the presets plugin, adds help for a bunch of default keybindings in Neovim
|
||||
-- No actual key bindings are created
|
||||
presets = {
|
||||
operators = true, -- adds help for operators like d, y, ... and registers them for motion / text object completion
|
||||
motions = true, -- adds help for motions
|
||||
text_objects = true, -- help for text objects triggered after entering an operator
|
||||
windows = true, -- default bindings on <c-w>
|
||||
nav = true, -- misc bindings to work with windows
|
||||
z = true, -- bindings for folds, spelling and others prefixed with z
|
||||
g = true -- bindings for prefixed with g
|
||||
}
|
||||
},
|
||||
-- add operators that will trigger motion and text object completion
|
||||
-- to enable all native operators, set the preset / operators plugin above
|
||||
operators = {gc = "Comments"},
|
||||
key_labels = {
|
||||
-- override the label used to display some keys. It doesn't effect WK in any other way.
|
||||
-- For example:
|
||||
-- ["<space>"] = "SPC",
|
||||
-- ["<cr>"] = "RET",
|
||||
-- ["<tab>"] = "TAB",
|
||||
},
|
||||
icons = {
|
||||
breadcrumb = "»", -- symbol used in the command line area that shows your active key combo
|
||||
separator = "➜", -- symbol used between a key and it's label
|
||||
group = "+" -- symbol prepended to a group
|
||||
},
|
||||
window = {
|
||||
border = "none", -- none, single, double, shadow
|
||||
position = "bottom", -- bottom, top
|
||||
margin = {1, 0, 1, 0}, -- extra window margin [top, right, bottom, left]
|
||||
padding = {2, 2, 2, 2} -- extra window padding [top, right, bottom, left]
|
||||
},
|
||||
layout = {
|
||||
height = {min = 4, max = 25}, -- min and max height of the columns
|
||||
width = {min = 20, max = 50}, -- min and max width of the columns
|
||||
spacing = 3, -- spacing between columns
|
||||
align = "left" -- align columns left, center or right
|
||||
},
|
||||
ignore_missing = false, -- enable this to hide mappings for which you didn't specify a label
|
||||
hidden = {
|
||||
"<silent>", "<cmd>", "<Cmd>", "<cr>", "<CR>", "call", "lua", "require",
|
||||
"^:", "^ "
|
||||
}, -- hide mapping boilerplate
|
||||
show_help = true, -- show help message on the command line when the popup is visible
|
||||
triggers = "auto", -- automatically setup triggers
|
||||
-- triggers = {"<leader>"} -- or specify a list manually
|
||||
triggers_blacklist = {
|
||||
-- list of mode / prefixes that should never be hooked by WhichKey
|
||||
-- this is mostly relevant for key maps that start with a native binding
|
||||
-- most people should not need to change this
|
||||
i = {"j", "k"},
|
||||
v = {"j", "k"}
|
||||
}
|
||||
|
||||
}
|
||||
local wk = require("which-key")
|
||||
default_options = {noremap = true, silent = true}
|
||||
|
||||
-- register non leader based mappings
|
||||
--wk.register({ga = {"<Plug>(EasyAlign)", "Align", mode = "x"}})
|
||||
|
||||
-- Register all leader based mappings
|
||||
local wk = require("which-key")
|
||||
-- As an example, we will create the following mappings:
|
||||
-- * <leader>ff find files
|
||||
-- * <leader>fr show recent files
|
||||
-- * <leader>fb Foobar
|
||||
-- we'll document:
|
||||
-- * <leader>fn new file
|
||||
-- * <leader>fe edit file
|
||||
-- and hide <leader>1
|
||||
wk.register({
|
||||
["<leader>"] = {
|
||||
b = {
|
||||
name = "Buffers",
|
||||
b = {
|
||||
"<cmd>lua require'telescope.builtin'.buffers({ sort_mru = true, ignore_current_buffer = true })<cr>",
|
||||
"Find buffer"
|
||||
}
|
||||
},
|
||||
g = {
|
||||
name = "Git",
|
||||
c = { "<cmd>Neogit Commit<cr>", "Git Commit" },
|
||||
g = { "<cmd>Neogit<cr>", "Open NeoGit" },
|
||||
p = { "<cmd> Neogit Push<cr>" }
|
||||
},
|
||||
f = {
|
||||
name = "File",
|
||||
f = { "<cmd>Telescope find_files<cr>", "Find File" },
|
||||
r = { "<cmd>Telescope oldfiles<cr>", "Open Recent File" },
|
||||
n = { "<cmd>enew<cr>", "New File" },
|
||||
},
|
||||
},
|
||||
s = {
|
||||
name = "Search",
|
||||
c = {"<cmd>Telescope colorscheme<cr>", "Colorscheme" }
|
||||
}
|
||||
|
||||
})
|
||||
@@ -1,8 +0,0 @@
|
||||
return {
|
||||
"folke/which-key.nvim",
|
||||
event = "VeryLazy",
|
||||
init = function()
|
||||
vim.o.timeout = true
|
||||
vim.o.timeoutlen = 300
|
||||
end,
|
||||
}
|
||||
@@ -1,18 +0,0 @@
|
||||
-- Plugins
|
||||
local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim"
|
||||
if not vim.loop.fs_stat(lazypath) then
|
||||
vim.fn.system({
|
||||
"git",
|
||||
"clone",
|
||||
"--filter=blob:none",
|
||||
"https://github.com/folke/lazy.nvim.git",
|
||||
"--branch=stable", -- latest stable release
|
||||
lazypath,
|
||||
})
|
||||
end
|
||||
vim.opt.rtp:prepend(lazypath)
|
||||
|
||||
vim.g.mapleader = ' '
|
||||
vim.g.maplocalleader = ' '
|
||||
|
||||
require("lazy").setup('plugin-config')
|
||||
@@ -1,5 +0,0 @@
|
||||
-- Nightfox
|
||||
require('nightfox').load('terafox')
|
||||
--require('nightfox').load('terafox')
|
||||
--vim.cmd("colorscheme nightfox")
|
||||
|
||||
20
nvim/m-housh/init.lua
Normal file
20
nvim/m-housh/init.lua
Normal file
@@ -0,0 +1,20 @@
|
||||
-- Leader needs to be set before loading plugins
|
||||
vim.g.mapleader = " "
|
||||
vim.g.maplocalleader = " "
|
||||
-- Auto commands
|
||||
require('user.autocmd')
|
||||
|
||||
-- Plugins
|
||||
require('user.plugins')
|
||||
|
||||
-- Key maps
|
||||
require('user.mappings')
|
||||
|
||||
-- Theme (must stay after plugins are loaded)
|
||||
require('user.theme')
|
||||
|
||||
-- Common settings
|
||||
require('user.settings')
|
||||
|
||||
vim.o.shiftwidth = 2
|
||||
|
||||
49
nvim/m-housh/lazy-lock.json
Normal file
49
nvim/m-housh/lazy-lock.json
Normal file
@@ -0,0 +1,49 @@
|
||||
{
|
||||
"Comment.nvim": { "branch": "master", "commit": "0236521ea582747b58869cb72f70ccfa967d2e89" },
|
||||
"LuaSnip": { "branch": "master", "commit": "80a8528f084a97b624ae443a6f50ff8074ba486b" },
|
||||
"bufdelete.nvim": { "branch": "master", "commit": "07d1f8ba79dec59d42b975a4df1c732b2e4e37b4" },
|
||||
"cmp-buffer": { "branch": "main", "commit": "3022dbc9166796b644a841a02de8dd1cc1d311fa" },
|
||||
"cmp-calc": { "branch": "main", "commit": "ce91d14d2e7a8b3f6ad86d85e34d41c1ae6268d9" },
|
||||
"cmp-cmdline": { "branch": "main", "commit": "8ee981b4a91f536f52add291594e89fb6645e451" },
|
||||
"cmp-emoji": { "branch": "main", "commit": "19075c36d5820253d32e2478b6aaf3734aeaafa0" },
|
||||
"cmp-nvim-lsp": { "branch": "main", "commit": "44b16d11215dce86f253ce0c30949813c0a90765" },
|
||||
"cmp-path": { "branch": "main", "commit": "91ff86cd9c29299a64f968ebb45846c485725f23" },
|
||||
"cmp-spell": { "branch": "master", "commit": "32a0867efa59b43edbb2db67b0871cfad90c9b66" },
|
||||
"cmp_luasnip": { "branch": "master", "commit": "05a9ab28b53f71d1aece421ef32fee2cb857a843" },
|
||||
"formatter.nvim": { "branch": "master", "commit": "34dcdfa0c75df667743b2a50dd99c84a557376f0" },
|
||||
"friendly-snippets": { "branch": "main", "commit": "43727c2ff84240e55d4069ec3e6158d74cb534b6" },
|
||||
"go.nvim": { "branch": "master", "commit": "694af9c0ee3a1d11bdb312ec67eebde74b6a4bbe" },
|
||||
"guess-indent.nvim": { "branch": "main", "commit": "b8ae749fce17aa4c267eec80a6984130b94f80b2" },
|
||||
"guihua.lua": { "branch": "master", "commit": "5ad8dba19ce9b9fd8965598984dfdc9c119f97e4" },
|
||||
"lazy.nvim": { "branch": "main", "commit": "42fb1e89adb8008a401848e131c5ecb985db52f1" },
|
||||
"lazygit.nvim": { "branch": "main", "commit": "de35012036d43bca03628d40d083f7c02a4cda3f" },
|
||||
"lsp_signature.nvim": { "branch": "master", "commit": "33250c84c7a552daf28ac607d9d9e82f88cd0907" },
|
||||
"lspkind-nvim": { "branch": "master", "commit": "57610d5ab560c073c465d6faf0c19f200cb67e6e" },
|
||||
"lualine.nvim": { "branch": "master", "commit": "2248ef254d0a1488a72041cfb45ca9caada6d994" },
|
||||
"mason-lspconfig.nvim": { "branch": "main", "commit": "09be3766669bfbabbe2863c624749d8da392c916" },
|
||||
"mason.nvim": { "branch": "main", "commit": "cd7835b15f5a4204fc37e0aa739347472121a54c" },
|
||||
"neo-tree.nvim": { "branch": "v3.x", "commit": "0b9a83e6dc47513a81fd9086440d5638683f4f17" },
|
||||
"neodev.nvim": { "branch": "main", "commit": "d617d9eb27e73e701e446874c6ea2cb528719260" },
|
||||
"nightfox.nvim": { "branch": "main", "commit": "6a6076bd678f825ffbe16ec97807793c3167f1a7" },
|
||||
"noice.nvim": { "branch": "main", "commit": "8f1b53ab85f83e0687d0f267085ad781ec240432" },
|
||||
"nui.nvim": { "branch": "main", "commit": "c0c8e347ceac53030f5c1ece1c5a5b6a17a25b32" },
|
||||
"nvim-cmp": { "branch": "main", "commit": "d3a3056204e1a9dbb7c7fe36c114dc43b681768c" },
|
||||
"nvim-dap": { "branch": "master", "commit": "b595c820018a15b6d54bf53b5cbeaa6f2d7a27e2" },
|
||||
"nvim-dap-ui": { "branch": "master", "commit": "34160a7ce6072ef332f350ae1d4a6a501daf0159" },
|
||||
"nvim-dap-virtual-text": { "branch": "master", "commit": "57f1dbd0458dd84a286b27768c142e1567f3ce3b" },
|
||||
"nvim-lsp-installer": { "branch": "main", "commit": "17e0bfa5f2c8854d1636fcd036dc8284db136baa" },
|
||||
"nvim-lspconfig": { "branch": "master", "commit": "38da5bbe1eaab2394056109e48c7e195bdb8fdfe" },
|
||||
"nvim-notify": { "branch": "master", "commit": "e4a2022f4fec2d5ebc79afa612f96d8b11c627b3" },
|
||||
"nvim-treesitter": { "branch": "master", "commit": "0179a89656b4ce395a4487c07ae385b8425524ae" },
|
||||
"nvim-treesitter-textobjects": { "branch": "master", "commit": "eb208bfdfcf76efea0424747e23e44641e13aaa6" },
|
||||
"nvim-web-devicons": { "branch": "master", "commit": "f0267921c845c42685968401bc49aa65e18d3e09" },
|
||||
"plenary.nvim": { "branch": "master", "commit": "50012918b2fc8357b87cff2a7f7f0446e47da174" },
|
||||
"swift.nvim": { "branch": "main", "commit": "bbbd2e5eb988920ac35f00e67fbb08cb2ebbe958" },
|
||||
"telescope-fzf-native.nvim": { "branch": "main", "commit": "6c921ca12321edaa773e324ef64ea301a1d0da62" },
|
||||
"telescope.nvim": { "branch": "0.1.x", "commit": "7011eaae0ac1afe036e30c95cf80200b8dc3f21a" },
|
||||
"toggleterm.nvim": { "branch": "main", "commit": "c80844fd52ba76f48fabf83e2b9f9b93273f418d" },
|
||||
"vim-tmux-navigator": { "branch": "master", "commit": "7db70e08ea03b3e4d91f63713d76134512e28d7e" },
|
||||
"which-key.nvim": { "branch": "main", "commit": "4433e5ec9a507e5097571ed55c02ea9658fb268a" },
|
||||
"wrapping.nvim": { "branch": "master", "commit": "696febba72939cf9082e0fd9cb9c603254cfa8a6" },
|
||||
"zen-mode.nvim": { "branch": "main", "commit": "50e2e2a36cc97847d9ab3b1a3555ba2ef6839b50" }
|
||||
}
|
||||
81
nvim/m-housh/lua/user/autocmd.lua
Normal file
81
nvim/m-housh/lua/user/autocmd.lua
Normal file
@@ -0,0 +1,81 @@
|
||||
local defaultGroupOptions = { clear = true }
|
||||
local markdownGroup = vim.api.nvim_create_augroup("MyMarkdownGroup", defaultGroupOptions)
|
||||
local spellGroup = vim.api.nvim_create_augroup('SpellGroup', defaultGroupOptions)
|
||||
local createCmd = vim.api.nvim_create_autocmd
|
||||
local swiftGroup = vim.api.nvim_create_augroup('swift_lsp', { clear = true })
|
||||
|
||||
-- Remove all trailing whitespace on save
|
||||
vim.api.nvim_exec([[
|
||||
augroup TrimWhiteSpace
|
||||
au!
|
||||
autocmd BufWritePre * :%s/\s\+$//e
|
||||
augroup END
|
||||
]], false)
|
||||
|
||||
-- Prevent new line to also start with a comment
|
||||
vim.api.nvim_exec([[
|
||||
augroup NewLineComment
|
||||
au!
|
||||
au FileType * setlocal formatoptions-=c formatoptions-=r formatoptions-=o
|
||||
augroup END
|
||||
]], false)
|
||||
|
||||
-- Spell check
|
||||
createCmd(
|
||||
"BufEnter",
|
||||
{
|
||||
pattern = { '*.md', '*.markdown', '*.txt', '*.tex' },
|
||||
group = spellGroup,
|
||||
callback = function(_)
|
||||
vim.cmd.setlocal('textwidth=80')
|
||||
vim.cmd.setlocal('spell spelllang=en_us')
|
||||
end,
|
||||
}
|
||||
)
|
||||
|
||||
-- Markdown
|
||||
createCmd(
|
||||
"BufWritePost",
|
||||
{
|
||||
pattern = { "*.md", "*.markdown" },
|
||||
group = markdownGroup,
|
||||
callback = function(_)
|
||||
local cursor = vim.fn.getpos('.')
|
||||
vim.cmd("FormatWrite")
|
||||
vim.fn.setpos('.', cursor)
|
||||
end,
|
||||
}
|
||||
)
|
||||
|
||||
-- Go
|
||||
createCmd(
|
||||
"BufWritePre",
|
||||
{
|
||||
pattern = "*.go",
|
||||
callback = function()
|
||||
require('go.format').goimport()
|
||||
end,
|
||||
group = vim.api.nvim_create_augroup("GoFormat", defaultGroupOptions)
|
||||
}
|
||||
)
|
||||
|
||||
-- Swift
|
||||
-- createCmd(
|
||||
-- "FileType",
|
||||
-- {
|
||||
-- pattern = { 'swift' },
|
||||
-- callback = function()
|
||||
-- local root_dir = vim.fs.dirname(vim.fs.find({
|
||||
-- "Package.swift",
|
||||
-- ".git",
|
||||
-- }, { upward = true })[1])
|
||||
-- local client = vim.lsp.start({
|
||||
-- name = "sourcekit-lsp",
|
||||
-- cmd = { "sourcekit-lsp" },
|
||||
-- root_dir = root_dir
|
||||
-- })
|
||||
-- vim.lsp.buf_attach_client(0, client)
|
||||
-- end,
|
||||
-- group = swiftGroup
|
||||
-- }
|
||||
-- )
|
||||
126
nvim/m-housh/lua/user/mappings.lua
Normal file
126
nvim/m-housh/lua/user/mappings.lua
Normal file
@@ -0,0 +1,126 @@
|
||||
local keymap = vim.keymap.set
|
||||
local default_options = {noremap = true, silent = true}
|
||||
local telescope = require('telescope.builtin')
|
||||
-- local expr_options = {noremap = true, expr = true, silent = true}
|
||||
vim.g.mapleader = " "
|
||||
vim.g.maplocalleader = " "
|
||||
|
||||
-- easier escape key mapping
|
||||
keymap('i', 'jk', '<ESC>', default_options)
|
||||
|
||||
keymap('n', '<c-s>', ':w<CR>', default_options)
|
||||
keymap('i', '<c-s>', '<ESC>:w<CR>a', default_options)
|
||||
|
||||
-- paste over currently selected text without yanking it
|
||||
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)
|
||||
|
||||
-- Resizing panes
|
||||
keymap("n", "<Left>", ":vertical resize +1<CR>", default_options)
|
||||
keymap("n", "<Right>", ":vertical resize -1<CR>", default_options)
|
||||
keymap("n", "<Up>", ":resize -1<CR>", default_options)
|
||||
keymap("n", "<Down>", ":resize +1<CR>", default_options)
|
||||
|
||||
-- Move selected line / block of text in visual mode
|
||||
keymap("x", "K", ":move '<-2<CR>gv-gv", default_options)
|
||||
keymap("x", "J", ":move '>+1<CR>gv-gv", default_options)
|
||||
|
||||
-- Toggle neo-tree open or closed
|
||||
keymap("n", "<c-n>", "<CMD>:Neotree toggle<CR>", default_options)
|
||||
|
||||
-- Toggle Lazy Git
|
||||
keymap("n", '<leader>gg', ':LazyGit<CR>', default_options)
|
||||
keymap("n", "<leader>gf", ":Telescope git_files<CR>", default_options)
|
||||
keymap("n", "<leader>t", ":ToggleTerm<CR>", default_options)
|
||||
|
||||
-- Zen Mode Toggle
|
||||
keymap('n', '<leader>z', "<cmd>:ZenMode<CR>", default_options)
|
||||
|
||||
-- Toggle term key maps, that get attached when terminal is opened.
|
||||
function _G.set_terminal_keymaps()
|
||||
local opts = { buffer = 0 }
|
||||
vim.keymap.set('t', '<esc>', [[<C-\><C-n>]], opts)
|
||||
end
|
||||
|
||||
vim.cmd('autocmd! TermOpen term://* lua set_terminal_keymaps()')
|
||||
|
||||
-- Formatting
|
||||
keymap('n', '<leader>f', '<cmd>:Format<CR>', default_options)
|
||||
keymap('n', '<leader>F', '<cmd>:FormatWrite<CR>', default_options)
|
||||
|
||||
-- Telescope keymaps
|
||||
vim.keymap.set('n', '<leader>ff', telescope.find_files, {})
|
||||
vim.keymap.set('n', '<leader>fg', telescope.live_grep, {})
|
||||
vim.keymap.set('n', '<leader>fb', telescope.buffers, {})
|
||||
vim.keymap.set('n', '<leader>fh', telescope.help_tags, {})
|
||||
|
||||
-- Find espanso config files.
|
||||
keymap('n', '<leader>fe', function()
|
||||
telescope.find_files({
|
||||
cwd='$HOME/.dotfiles/espanso/espanso'
|
||||
})
|
||||
end, default_options)
|
||||
|
||||
-- Find nvim config files.
|
||||
keymap('n', '<leader>fn', function()
|
||||
telescope.find_files({
|
||||
cwd='$HOME/.dotfiles/nvim/m-housh'
|
||||
})
|
||||
end, default_options)
|
||||
|
||||
-- Find script files.
|
||||
keymap('n', '<leader>fs', function()
|
||||
telescope.find_files({
|
||||
cwd='$HOME/.dotfiles/scripts/scripts'
|
||||
})
|
||||
end, default_options)
|
||||
|
||||
-- Find zsh config files.
|
||||
keymap('n', '<leader>fz', function()
|
||||
telescope.find_files({
|
||||
cwd = '$HOME/.dotfiles/zsh/config',
|
||||
hidden = true
|
||||
})
|
||||
end, default_options)
|
||||
|
||||
-- Turn off highlighting after search.
|
||||
keymap('n', '<leader>n', '<cmd>:noh<cr>', default_options)
|
||||
|
||||
-- Toggle Spell Checking.
|
||||
keymap('n', '<leader>s', '<cmd>:set spell!<cr>', default_options)
|
||||
|
||||
-- LuaSnip Keymaps
|
||||
--local ls = require('luasnip')
|
||||
|
||||
-- <c-k> to expand snippets.
|
||||
-- This will expand the snippet or jump to the next item within the snippet.
|
||||
-- vim.keymap.set({ "i", "s" }, "<c-k>", function()
|
||||
-- if ls.expand_or_jumpable() then
|
||||
-- ls.expand_or_jump()
|
||||
-- end
|
||||
-- end, { silent = true })
|
||||
|
||||
|
||||
-- <c-j>
|
||||
-- This will jump backwards in the snippet.
|
||||
-- vim.keymap.set({ "i", "s" }, "<c-j>", function()
|
||||
-- if ls.jumpable(-1) then
|
||||
-- ls.jump(-1)
|
||||
-- end
|
||||
-- end, { silent = true })
|
||||
|
||||
-- <c-l>
|
||||
-- This is for selecting withing a list of options.
|
||||
-- vim.keymap.set("i", "<c-l>", function()
|
||||
-- if ls.choice_active() then
|
||||
-- ls.change_choice(1)
|
||||
-- end
|
||||
-- end, { silent = true })
|
||||
|
||||
-- Reload the snippets.
|
||||
--vim.keymap.set("n", "<leader><leader>s", "<cmd>source ~/.config/m-housh/lua/snippets/init.lua<cr>")
|
||||
@@ -6,16 +6,24 @@ return {
|
||||
"hrsh7th/cmp-buffer",
|
||||
"hrsh7th/cmp-path",
|
||||
"hrsh7th/cmp-cmdline",
|
||||
"hrsh7th/cmp-vsnip",
|
||||
--"hrsh7th/cmp-vsnip",
|
||||
'saadparwaiz1/cmp_luasnip',
|
||||
"f3fora/cmp-spell",
|
||||
"hrsh7th/cmp-calc",
|
||||
"hrsh7th/cmp-emoji"
|
||||
"hrsh7th/cmp-emoji",
|
||||
"L3MON4D3/LuaSnip",
|
||||
|
||||
-- Adds a number of user-friendly snippets
|
||||
'rafamadriz/friendly-snippets',
|
||||
},
|
||||
event = { 'BufReadPre', 'BufNewFile' },
|
||||
config = function()
|
||||
-- Setup nvim-cmp.
|
||||
local cmp = require "cmp"
|
||||
local lspkind = require("lspkind")
|
||||
local capabilities = require('cmp_nvim_lsp').default_capabilities()
|
||||
local capabilities = vim.lsp.protocol.make_client_capabilities()
|
||||
capabilities = require('cmp_nvim_lsp').default_capabilities(capabilities)
|
||||
local luasnip = require('luasnip')
|
||||
|
||||
local has_words_before = function()
|
||||
local line, col = unpack(vim.api.nvim_win_get_cursor(0))
|
||||
@@ -36,9 +44,10 @@ return {
|
||||
|
||||
lspkind.init({
|
||||
symbol_map = {
|
||||
Text = "",
|
||||
Method = "",
|
||||
Function = "",
|
||||
|
||||
Text = "",
|
||||
Method = "",
|
||||
Function = "",
|
||||
Constructor = "",
|
||||
Field = "ﰠ",
|
||||
Variable = "",
|
||||
@@ -64,6 +73,9 @@ return {
|
||||
}
|
||||
})
|
||||
|
||||
-- Configure nvim-cmp.
|
||||
require('luasnip.loaders.from_vscode').lazy_load()
|
||||
luasnip.config.setup {}
|
||||
cmp.setup({
|
||||
formatting = {
|
||||
format = lspkind.cmp_format {
|
||||
@@ -82,9 +94,10 @@ return {
|
||||
},
|
||||
experimental = {native_menu = false, ghost_text = false},
|
||||
snippet = {
|
||||
expand = function(args)
|
||||
vim.fn["vsnip#anonymous"](args.body) -- For `vsnip` users.
|
||||
end
|
||||
expand = function(args)
|
||||
luasnip.lsp_expand(args.body)
|
||||
--require('luasnip').lsp_expand(args.body)
|
||||
end
|
||||
},
|
||||
mapping = {
|
||||
["<C-p>"] = cmp.mapping.select_prev_item(),
|
||||
@@ -92,34 +105,40 @@ return {
|
||||
["<C-d>"] = cmp.mapping.scroll_docs(-4),
|
||||
["<C-f>"] = cmp.mapping.scroll_docs(4),
|
||||
["<C-Space>"] = cmp.mapping.complete(),
|
||||
["<C-e>"] = cmp.mapping.close(),
|
||||
["<C-e>"] = cmp.mapping.abort(),
|
||||
["<CR>"] = cmp.mapping.confirm {
|
||||
behavior = cmp.ConfirmBehavior.Replace,
|
||||
select = false
|
||||
select = true
|
||||
},
|
||||
["<Tab>"] = cmp.mapping(function(fallback)
|
||||
if cmp.visible() then
|
||||
cmp.select_next_item()
|
||||
elseif vim.fn["vsnip#available"](1) == 1 then
|
||||
feedkey("<Plug>(vsnip-expand-or-jump)", "")
|
||||
elseif has_words_before() then
|
||||
cmp.complete()
|
||||
else
|
||||
fallback() -- The fallback function sends a already mapped key. In this case, it's probably `<Tab>`.
|
||||
end
|
||||
if cmp.visible() then
|
||||
cmp.select_next_item()
|
||||
elseif luasnip.expandable() then
|
||||
luasnip.expand()
|
||||
elseif luasnip.expand_or_jumpable() then
|
||||
luasnip.expand_or_jump()
|
||||
elseif has_words_before() then
|
||||
cmp.complete()
|
||||
else
|
||||
fallback()
|
||||
end
|
||||
end, {"i", "s"}),
|
||||
["<S-Tab>"] = cmp.mapping(function()
|
||||
if cmp.visible() then
|
||||
cmp.select_prev_item()
|
||||
elseif vim.fn["vsnip#jumpable"](-1) == 1 then
|
||||
feedkey("<Plug>(vsnip-jump-prev)", "")
|
||||
-- elseif vim.fn["vsnip#jumpable"](-1) == 1 then
|
||||
-- feedkey("<Plug>(vsnip-jump-prev)", "")
|
||||
end
|
||||
end, {"i", "s"})
|
||||
},
|
||||
},
|
||||
sources = {
|
||||
{name = "nvim_lsp"}, {name = "buffer", keyword_length = 5},
|
||||
{name = "vsnip"}, {name = "calc"}, {name = "emoji"}, {name = "spell"},
|
||||
{name = "path"}
|
||||
{name = "nvim_lsp"},
|
||||
{name = "buffer", keyword_length = 5},
|
||||
{name = 'luasnip', option = { show_autosnippets = true } },
|
||||
{name = "calc"},
|
||||
{name = "emoji"},
|
||||
{name = "spell"},
|
||||
{name = "path"}
|
||||
}
|
||||
})
|
||||
|
||||
7
nvim/m-housh/lua/user/plugin/comment.lua
Normal file
7
nvim/m-housh/lua/user/plugin/comment.lua
Normal file
@@ -0,0 +1,7 @@
|
||||
return {
|
||||
'numToStr/Comment.nvim',
|
||||
opts = {
|
||||
-- add any options here
|
||||
},
|
||||
event = { 'BufReadPre', 'BufNewFile' },
|
||||
}
|
||||
32
nvim/m-housh/lua/user/plugin/formatter.lua
Normal file
32
nvim/m-housh/lua/user/plugin/formatter.lua
Normal file
@@ -0,0 +1,32 @@
|
||||
return {
|
||||
"mhartington/formatter.nvim",
|
||||
event = { 'BufReadPre', 'BufNewFile' },
|
||||
config = function()
|
||||
local util = require("formatter.util")
|
||||
require("formatter").setup({
|
||||
filetype = {
|
||||
markdown = function()
|
||||
return {
|
||||
exe = "prettier",
|
||||
args = {
|
||||
"--stdin-filepath",
|
||||
util.escape_path(util.get_current_buffer_file_path()),
|
||||
"--print-width",
|
||||
"80",
|
||||
"--prose-wrap",
|
||||
"always",
|
||||
"--parser",
|
||||
"markdown"
|
||||
},
|
||||
stdin = true,
|
||||
try_node_modules = true,
|
||||
}
|
||||
end,
|
||||
["*"] = {
|
||||
-- formatter for any / all file types.
|
||||
require("formatter.filetypes.any").remove_trailing_whitespace
|
||||
}
|
||||
}
|
||||
})
|
||||
end
|
||||
}
|
||||
18
nvim/m-housh/lua/user/plugin/go.lua
Normal file
18
nvim/m-housh/lua/user/plugin/go.lua
Normal file
@@ -0,0 +1,18 @@
|
||||
return {
|
||||
"ray-x/go.nvim",
|
||||
lazy = true,
|
||||
dependencies = { -- optional packages
|
||||
"ray-x/guihua.lua",
|
||||
"neovim/nvim-lspconfig",
|
||||
"nvim-treesitter/nvim-treesitter",
|
||||
'mfussenegger/nvim-dap',
|
||||
'rcarriga/nvim-dap-ui',
|
||||
'theHamsta/nvim-dap-virtual-text',
|
||||
},
|
||||
config = function()
|
||||
require("go").setup()
|
||||
end,
|
||||
--event = {'BufReadPre', 'BufNewFile'},
|
||||
ft = {"go", 'gomod'},
|
||||
build = ':lua require("go.install").update_all_sync()' -- if you need to install/update all binaries
|
||||
}
|
||||
31
nvim/m-housh/lua/user/plugin/init.lua
Normal file
31
nvim/m-housh/lua/user/plugin/init.lua
Normal file
@@ -0,0 +1,31 @@
|
||||
-- This file contains plugin's that don't require much configuration.
|
||||
return {
|
||||
{
|
||||
"L3MON4D3/LuaSnip",
|
||||
version = "2.*",
|
||||
build = "make install_jsregexp",
|
||||
event = { 'BufReadPre', 'BufNewFile' },
|
||||
config = function()
|
||||
local luasnip = require('luasnip')
|
||||
local types = require('luasnip.util.types')
|
||||
luasnip.config.set_config {
|
||||
history = true,
|
||||
updateevents = "TextChanged,TextChangedI",
|
||||
enable_autosnippets = true,
|
||||
ext_opts = {
|
||||
[types.choiceNode] = {
|
||||
active = {
|
||||
virt_text = { { "<-", "Error" } },
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
||||
end
|
||||
},
|
||||
{
|
||||
"hrsh7th/vim-vsnip",
|
||||
config = function()
|
||||
vim.g.vsnip_snippet_dir = os.getenv('HOME') .. '/.config/m-housh/lua/snippets/'
|
||||
end
|
||||
},
|
||||
}
|
||||
10
nvim/m-housh/lua/user/plugin/lazygit.lua
Normal file
10
nvim/m-housh/lua/user/plugin/lazygit.lua
Normal file
@@ -0,0 +1,10 @@
|
||||
return {
|
||||
"kdheepak/lazygit.nvim",
|
||||
dependencies = {
|
||||
"nvim-telescope/telescope.nvim",
|
||||
"nvim-lua/plenary.nvim"
|
||||
},
|
||||
config = function()
|
||||
require("telescope").load_extension("lazygit")
|
||||
end,
|
||||
}
|
||||
224
nvim/m-housh/lua/user/plugin/lsp.lua
Normal file
224
nvim/m-housh/lua/user/plugin/lsp.lua
Normal file
@@ -0,0 +1,224 @@
|
||||
return {
|
||||
{
|
||||
"williamboman/nvim-lsp-installer",
|
||||
config = function()
|
||||
require("nvim-lsp-installer").setup({})
|
||||
end
|
||||
},
|
||||
{
|
||||
"williamboman/mason-lspconfig.nvim",
|
||||
dependencies = {
|
||||
"williamboman/mason.nvim",
|
||||
"onsails/lspkind-nvim",
|
||||
"famiu/bufdelete.nvim",
|
||||
"ray-x/lsp_signature.nvim",
|
||||
"neovim/nvim-lspconfig",
|
||||
"folke/neodev.nvim",
|
||||
"mhartington/formatter.nvim",
|
||||
"ray-x/go.nvim",
|
||||
},
|
||||
opts = {
|
||||
ensure_installed = {
|
||||
"bashls",
|
||||
"clangd",
|
||||
"dockerls",
|
||||
"gopls",
|
||||
"jsonls",
|
||||
"jedi_language_server",
|
||||
"lua_ls",
|
||||
"marksman",
|
||||
"terraformls",
|
||||
"tsserver",
|
||||
"texlab",
|
||||
"yamlls",
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"neovim/nvim-lspconfig",
|
||||
dependencies = {
|
||||
"hrsh7th/cmp-nvim-lsp",
|
||||
},
|
||||
config = function()
|
||||
require('neodev').setup()
|
||||
require("mason").setup()
|
||||
require("mason-lspconfig").setup()
|
||||
local nvim_lsp = require("lspconfig")
|
||||
|
||||
-- Use an on_attach function to only map the following keys
|
||||
-- after the language server attaches to the current buffer
|
||||
local on_attach = function(bufnr)
|
||||
local function buf_set_keymap(...)
|
||||
vim.api.nvim_buf_set_keymap(bufnr, ...)
|
||||
end
|
||||
|
||||
-- Mappings.
|
||||
local opts = {noremap = true, silent = true}
|
||||
|
||||
-- See `:help vim.lsp.*` for documentation on any of the below functions
|
||||
buf_set_keymap("n", "gD", "<Cmd>lua vim.lsp.buf.declaration()<CR>", opts)
|
||||
buf_set_keymap("n", "gd", "<Cmd>lua vim.lsp.buf.definition()<CR>", opts)
|
||||
buf_set_keymap("n", "K", "<Cmd>lua vim.lsp.buf.hover()<CR>", opts)
|
||||
buf_set_keymap("n", "gi", "<cmd>lua vim.lsp.buf.implementation()<CR>", opts)
|
||||
buf_set_keymap("n", "gT", vim.lsp.buf.type_definition, opts)
|
||||
-- buf_set_keymap('n', '<C-k>', '<cmd>lua vim.lsp.buf.signature_help()<CR>', opts)
|
||||
buf_set_keymap("n", "<space>wa",
|
||||
"<cmd>lua vim.lsp.buf.add_workspace_folder()<CR>", opts)
|
||||
buf_set_keymap("n", "<space>wr",
|
||||
"<cmd>lua vim.lsp.buf.remove_workspace_folder()<CR>", opts)
|
||||
buf_set_keymap("n", "<space>wl",
|
||||
"<cmd>lua print(vim.inspect(vim.lsp.buf.list_workspace_folders()))<CR>",
|
||||
opts)
|
||||
buf_set_keymap("n", "<space>D",
|
||||
"<cmd>lua vim.lsp.buf.type_definition()<CR>", opts)
|
||||
buf_set_keymap("n", "<space>rn", "<cmd>lua vim.lsp.buf.rename()<CR>", opts)
|
||||
buf_set_keymap("n", "<space>ca", "<cmd>lua vim.lsp.buf.code_action()<CR>",
|
||||
opts)
|
||||
buf_set_keymap("n", "gr", "<cmd>lua vim.lsp.buf.references()<CR>", opts)
|
||||
buf_set_keymap("n", "<space>e", "<cmd>lua vim.lsp.diagnostic.show_line_diagnostics()<CR>", opts)
|
||||
buf_set_keymap("n", "[d", "<cmd>lua vim.lsp.diagnostic.goto_prev()<CR>", opts)
|
||||
|
||||
buf_set_keymap("n", "]d", "<cmd>lua vim.lsp.diagnostic.goto_next()<CR>", opts)
|
||||
buf_set_keymap("n", "<space>q", "<cmd>lua vim.lsp.diagnostic.set_loclist()<CR>", opts)
|
||||
buf_set_keymap("n", "<space>f", "<cmd>lua vim.lsp.buf.formatting()<CR>", opts)
|
||||
|
||||
vim.api.nvim_buf_set_option(bufnr, 'omnifunc', 'v:lua.vim.lsp.omnifunc')
|
||||
end
|
||||
|
||||
-- Use a loop to conveniently call 'setup' on multiple servers and
|
||||
-- map buffer local keybindings when the language server attaches
|
||||
--local capabilities = vim.lsp.protocol.make_client_capabilities()
|
||||
local capabilities = require("cmp_nvim_lsp").default_capabilities()
|
||||
|
||||
local servers = {
|
||||
"bashls",
|
||||
"clangd",
|
||||
"dockerls",
|
||||
"gopls",
|
||||
"jsonls",
|
||||
"jedi_language_server",
|
||||
"lua_ls",
|
||||
"marksman",
|
||||
"sourcekit",
|
||||
"terraformls",
|
||||
"tsserver",
|
||||
"texlab",
|
||||
"yamlls",
|
||||
}
|
||||
for _, lsp in ipairs(servers) do
|
||||
nvim_lsp[lsp].setup {
|
||||
on_attach = on_attach,
|
||||
capabilities = capabilities,
|
||||
settings = {
|
||||
gopls = {
|
||||
experimentalPostfixCompletions = true,
|
||||
analyses = {
|
||||
unusedparams = true,
|
||||
shadow = true
|
||||
},
|
||||
staticcheck = true
|
||||
},
|
||||
lua_ls = {
|
||||
Lua = {
|
||||
completion = {
|
||||
callSnippet = "Replace"
|
||||
},
|
||||
workspace = { checkThirdParty = false },
|
||||
telemetry = { enable = false },
|
||||
}
|
||||
},
|
||||
json = {
|
||||
format = {enabled = false},
|
||||
schemas = {
|
||||
{
|
||||
description = "ESLint config",
|
||||
fileMatch = {".eslintrc.json", ".eslintrc"},
|
||||
url = "http://json.schemastore.org/eslintrc"
|
||||
}, {
|
||||
description = "Package config",
|
||||
fileMatch = {"package.json"},
|
||||
url = "https://json.schemastore.org/package"
|
||||
}, {
|
||||
description = "Packer config",
|
||||
fileMatch = {"packer.json"},
|
||||
url = "https://json.schemastore.org/packer"
|
||||
}, {
|
||||
description = "Renovate config",
|
||||
fileMatch = {
|
||||
"renovate.json", "renovate.json5",
|
||||
".github/renovate.json", ".github/renovate.json5",
|
||||
".renovaterc", ".renovaterc.json"
|
||||
},
|
||||
url = "https://docs.renovatebot.com/renovate-schema"
|
||||
}, {
|
||||
description = "OpenApi config",
|
||||
fileMatch = {"*api*.json"},
|
||||
url = "https://raw.githubusercontent.com/OAI/OpenAPI-Specification/main/schemas/v3.1/schema.json"
|
||||
}
|
||||
}
|
||||
},
|
||||
redhat = {telemetry = {enabled = false}},
|
||||
texlab = {
|
||||
auxDirectory = ".",
|
||||
bibtexFormatter = "texlab",
|
||||
build = {
|
||||
args = {
|
||||
"--keep-intermediates", "--keep-logs", "--synctex", "%f"
|
||||
},
|
||||
executable = "tectonic",
|
||||
forwardSearchAfter = false,
|
||||
onSave = false
|
||||
},
|
||||
chktex = {onEdit = false, onOpenAndSave = false},
|
||||
diagnosticsDelay = 300,
|
||||
formatterLineLength = 80,
|
||||
forwardSearch = {args = {}},
|
||||
latexFormatter = "latexindent",
|
||||
latexindent = {modifyLineBreaks = false}
|
||||
},
|
||||
yaml = {
|
||||
schemaStore = {
|
||||
enable = true,
|
||||
url = "https://www.schemastore.org/api/json/catalog.json"
|
||||
},
|
||||
schemas = {
|
||||
kubernetes = "/*.yaml",
|
||||
["http://json.schemastore.org/github-workflow"] = ".github/workflows/*.{yml,yaml}",
|
||||
["http://json.schemastore.org/github-action"] = ".github/action.{yml,yaml}",
|
||||
["http://json.schemastore.org/ansible-stable-2.9"] = "roles/tasks/*.{yml,yaml}",
|
||||
["http://json.schemastore.org/prettierrc"] = ".prettierrc.{yml,yaml}",
|
||||
["http://json.schemastore.org/kustomization"] = "kustomization.{yml,yaml}",
|
||||
["http://json.schemastore.org/ansible-playbook"] = "*play*.{yml,yaml}",
|
||||
["http://json.schemastore.org/chart"] = "Chart.{yml,yaml}",
|
||||
["https://json.schemastore.org/dependabot-v2"] = ".github/dependabot.{yml,yaml}",
|
||||
["https://json.schemastore.org/gitlab-ci"] = "*gitlab-ci*.{yml,yaml}",
|
||||
["https://raw.githubusercontent.com/OAI/OpenAPI-Specification/main/schemas/v3.1/schema.json"] = "*api*.{yml,yaml}",
|
||||
["https://raw.githubusercontent.com/compose-spec/compose-spec/master/schema/compose-spec.json"] = "docker-compose.{yml,yaml}",
|
||||
["https://raw.githubusercontent.com/argoproj/argo-workflows/master/api/jsonschema/schema.json"] = "*flow*.{yml,yaml}"
|
||||
},
|
||||
format = {enabled = false},
|
||||
validate = false, -- TODO: conflicts between Kubernetes resources and kustomization.yaml
|
||||
completion = true,
|
||||
hover = true
|
||||
}
|
||||
},
|
||||
flags = {debounce_text_changes = 150}
|
||||
}
|
||||
require"lsp_signature".setup({
|
||||
bind = true, -- This is mandatory, otherwise border config won't get registered.
|
||||
floating_window = true, -- show hint in a floating window, set to false for virtual text only mode
|
||||
doc_lines = 2, -- Set to 0 for not showing doc
|
||||
hint_prefix = "🐼 ",
|
||||
-- use_lspsaga = false, -- set to true if you want to use lspsaga popup
|
||||
handler_opts = {
|
||||
border = "shadow" -- double, single, shadow, none
|
||||
}
|
||||
})
|
||||
end
|
||||
|
||||
-- Test source-kit
|
||||
require('lspconfig').sourcekit.setup{}
|
||||
|
||||
end
|
||||
}
|
||||
}
|
||||
25
nvim/m-housh/lua/user/plugin/neo-tree.lua
Normal file
25
nvim/m-housh/lua/user/plugin/neo-tree.lua
Normal file
@@ -0,0 +1,25 @@
|
||||
return {
|
||||
"nvim-neo-tree/neo-tree.nvim",
|
||||
branch = "v3.x",
|
||||
dependencies = {
|
||||
"nvim-lua/plenary.nvim",
|
||||
"nvim-tree/nvim-web-devicons", -- not strictly required, but recommended
|
||||
"MunifTanjim/nui.nvim",
|
||||
},
|
||||
opts = {
|
||||
close_if_last_window = false,
|
||||
enable_git_status = true,
|
||||
enable_diagnostics = true,
|
||||
filesystem = {
|
||||
always_show = {
|
||||
"plugins",
|
||||
".zshrc",
|
||||
".zshenv"
|
||||
},
|
||||
filtered_items = {
|
||||
hide_dotfiles = false
|
||||
},
|
||||
use_libuv_file_watcher = true
|
||||
},
|
||||
}
|
||||
}
|
||||
47
nvim/m-housh/lua/user/plugin/noice.lua
Normal file
47
nvim/m-housh/lua/user/plugin/noice.lua
Normal file
@@ -0,0 +1,47 @@
|
||||
return {
|
||||
"folke/noice.nvim",
|
||||
event = "VeryLazy",
|
||||
-- config.lsp.signature.enabled = false
|
||||
opts = {
|
||||
lsp = {
|
||||
-- override markdown rendering so that **cmp** and other plugins use **Treesitter**
|
||||
override = {
|
||||
["vim.lsp.util.convert_input_to_markdown_lines"] = true,
|
||||
["vim.lsp.util.stylize_markdown"] = true,
|
||||
["cmp.entry.get_documentation"] = true,
|
||||
},
|
||||
-- you can enable a preset for easier configuration
|
||||
presets = {
|
||||
bottom_search = true, -- use a classic bottom cmdline for search
|
||||
command_palette = true, -- position the cmdline and popupmenu together
|
||||
long_message_to_split = true, -- long messages will be sent to a split
|
||||
inc_rename = false, -- enables an input dialog for inc-rename.nvim
|
||||
lsp_doc_border = false, -- add a border to hover docs and signature help
|
||||
},
|
||||
signature = { enabled = false },
|
||||
},
|
||||
routes = {
|
||||
{ -- enables messages for showing macro recording.
|
||||
view = "notify",
|
||||
filter = { event = "msg_showmode" },
|
||||
},
|
||||
{ -- Hide the written messages.
|
||||
view = 'notify',
|
||||
filter = {
|
||||
event = "msg_show",
|
||||
kind = "",
|
||||
find = "written"
|
||||
},
|
||||
opts = { skip = true }
|
||||
}
|
||||
},
|
||||
},
|
||||
dependencies = {
|
||||
-- if you lazy-load any plugin below, make sure to add proper `module="..."` entries
|
||||
"MunifTanjim/nui.nvim",
|
||||
-- OPTIONAL:
|
||||
-- `nvim-notify` is only needed, if you want to use the notification view.
|
||||
-- If not available, we use `mini` as the fallback
|
||||
"rcarriga/nvim-notify",
|
||||
},
|
||||
}
|
||||
15
nvim/m-housh/lua/user/plugin/swift.lua
Normal file
15
nvim/m-housh/lua/user/plugin/swift.lua
Normal file
@@ -0,0 +1,15 @@
|
||||
return {
|
||||
'm-housh/swift.nvim',
|
||||
dependencies = {
|
||||
'akinsho/toggleterm.nvim'
|
||||
},
|
||||
ft = { 'swift' },
|
||||
config = function()
|
||||
require('swift').setup()
|
||||
local default_options = { noremap = true, silent = true }
|
||||
local actions = require('swift.actions')
|
||||
|
||||
vim.keymap.set('n', '<c-b>', actions.build, default_options)
|
||||
vim.keymap.set('n', '<c-u>', actions.test, default_options)
|
||||
end
|
||||
}
|
||||
@@ -4,12 +4,13 @@ return {
|
||||
dependencies = {
|
||||
'nvim-lua/plenary.nvim'
|
||||
},
|
||||
lazy = true,
|
||||
config = function()
|
||||
local actions = require('telescope.actions')
|
||||
|
||||
require('telescope').setup({
|
||||
defaults = {
|
||||
file_ignore_patterns = {"node_modules", "%.jpg", "%.png"},
|
||||
file_ignore_patterns = {"node_modules", "%.jpg", "%.png", ".swiftpm"},
|
||||
vimgrep_arguments = {
|
||||
'rg',
|
||||
'--follow',
|
||||
@@ -67,12 +68,5 @@ return {
|
||||
buffer_previewer_maker = require'telescope.previewers'.buffer_previewer_maker
|
||||
}
|
||||
})
|
||||
|
||||
local builtin = require('telescope.builtin')
|
||||
-- Telescope keymaps
|
||||
vim.keymap.set('n', '<leader>ff', builtin.find_files, {})
|
||||
vim.keymap.set('n', '<leader>fg', builtin.live_grep, {})
|
||||
vim.keymap.set('n', '<leader>fb', builtin.buffers, {})
|
||||
vim.keymap.set('n', '<leader>fh', builtin.help_tags, {})
|
||||
end
|
||||
}
|
||||
24
nvim/m-housh/lua/user/plugin/theme.lua
Normal file
24
nvim/m-housh/lua/user/plugin/theme.lua
Normal file
@@ -0,0 +1,24 @@
|
||||
return {
|
||||
'EdenEast/nightfox.nvim',
|
||||
lazy = false, -- make sure we load this during startup
|
||||
priority = 1000, -- make sure to load this before all other plugins.
|
||||
opts = {
|
||||
--fox = "terafox", -- change the colorscheme to use terafox
|
||||
styles = {
|
||||
comments = "italic", -- change style of comments to be italic
|
||||
keywords = "bold", -- change style of keywords to be bold
|
||||
functions = "italic,bold" -- styles can be a comma separated list
|
||||
},
|
||||
inverse = {
|
||||
match_paren = true, -- inverse the highlighting of match_parens
|
||||
},
|
||||
colors = {
|
||||
red = "#FF0000", -- Override the red color for MAX POWER
|
||||
--bg_alt = "#000000",
|
||||
},
|
||||
hlgroups = {
|
||||
TSPunctDelimiter = { fg = "${red}" }, -- Override a highlight group with the color red
|
||||
LspCodeLens = { bg = "#000000", style = "italic" },
|
||||
}
|
||||
},
|
||||
}
|
||||
26
nvim/m-housh/lua/user/plugin/toggleterm.lua
Normal file
26
nvim/m-housh/lua/user/plugin/toggleterm.lua
Normal file
@@ -0,0 +1,26 @@
|
||||
return {
|
||||
'akinsho/toggleterm.nvim',
|
||||
enable = true,
|
||||
lazy = true,
|
||||
opts = {
|
||||
size = 20,
|
||||
open_mapping = [[<c-\>]],
|
||||
hide_numbers = true,
|
||||
shade_terminals = true,
|
||||
shading_factor = 2,
|
||||
start_in_insert = true,
|
||||
insert_mappings = true,
|
||||
persist_size = true,
|
||||
direction = "float",
|
||||
close_on_exit = true,
|
||||
shell = vim.o.shell,
|
||||
float_opts = {
|
||||
border = "curved",
|
||||
winblend = 0,
|
||||
highlights = {
|
||||
border = "Normal",
|
||||
background = "Normal",
|
||||
},
|
||||
},
|
||||
}
|
||||
}
|
||||
@@ -4,6 +4,8 @@ return {
|
||||
'nvim-telescope/telescope-fzf-native.nvim',
|
||||
'nvim-treesitter/nvim-treesitter-textobjects',
|
||||
},
|
||||
build = ':TSUpdate',
|
||||
event = { 'BufReadPre', 'BufNewFile' },
|
||||
config = function()
|
||||
require('nvim-treesitter.configs').setup {
|
||||
ensure_installed = {
|
||||
@@ -18,9 +20,14 @@ return {
|
||||
"json",
|
||||
"latex",
|
||||
"ledger",
|
||||
"llvm",
|
||||
"lua",
|
||||
"make",
|
||||
"markdown",
|
||||
"python",
|
||||
"swift",
|
||||
"toml",
|
||||
"xml",
|
||||
"yaml"
|
||||
}, -- one of "all", "maintained" (parsers with maintainers), or a list of languages
|
||||
ignore_install = {}, -- List of parsers to ignore installing
|
||||
@@ -55,7 +62,9 @@ return {
|
||||
["ib"] = "@block.inner",
|
||||
["ab"] = "@block.outer",
|
||||
["ir"] = "@parameter.inner",
|
||||
["ar"] = "@parameter.outer"
|
||||
["ar"] = "@parameter.outer",
|
||||
["a="] = "@assignment.outer",
|
||||
["i="] = "@assignment.inner",
|
||||
}
|
||||
}
|
||||
},
|
||||
8
nvim/m-housh/lua/user/plugin/which-key.lua
Normal file
8
nvim/m-housh/lua/user/plugin/which-key.lua
Normal file
@@ -0,0 +1,8 @@
|
||||
return {
|
||||
"folke/which-key.nvim",
|
||||
event = "VeryLazy",
|
||||
init = function()
|
||||
vim.o.timeout = true
|
||||
vim.o.timeoutlen = 300
|
||||
end,
|
||||
}
|
||||
17
nvim/m-housh/lua/user/plugin/wrapping.lua
Normal file
17
nvim/m-housh/lua/user/plugin/wrapping.lua
Normal file
@@ -0,0 +1,17 @@
|
||||
return {
|
||||
"andrewferrier/wrapping.nvim",
|
||||
event = { 'BufReadPre', 'BufNewFile' },
|
||||
opts = {
|
||||
auto_set_mode_filetype_allowlist = {
|
||||
"asciidoc",
|
||||
"gitcommit",
|
||||
"latex",
|
||||
"markdown",
|
||||
"tex",
|
||||
"text"
|
||||
},
|
||||
softener = {
|
||||
markdown = 1.3
|
||||
},
|
||||
},
|
||||
}
|
||||
62
nvim/m-housh/lua/user/plugins.lua
Normal file
62
nvim/m-housh/lua/user/plugins.lua
Normal file
@@ -0,0 +1,62 @@
|
||||
-- Bootstrap Lazy.
|
||||
local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim"
|
||||
if not vim.loop.fs_stat(lazypath) then
|
||||
vim.fn.system({
|
||||
"git",
|
||||
"clone",
|
||||
"--filter=blob:none",
|
||||
"https://github.com/folke/lazy.nvim.git",
|
||||
"--branch=stable", -- latest stable release
|
||||
lazypath,
|
||||
})
|
||||
end
|
||||
vim.opt.rtp:prepend(lazypath)
|
||||
|
||||
require("lazy").setup({
|
||||
dev = {
|
||||
path = '~/LocalProjects/plugins',
|
||||
fallback = true
|
||||
},
|
||||
|
||||
-- Theme --
|
||||
{ import = 'user.plugin.theme' },
|
||||
|
||||
-- Completions --
|
||||
{ import = 'user.plugin.cmp' },
|
||||
|
||||
-- Git --
|
||||
{ import = 'user.plugin.lazygit' },
|
||||
|
||||
-- LSP, formatting, etc. --
|
||||
{ 'folke/neodev.nvim', opts = {} },
|
||||
{ import = 'user.plugin.lsp' },
|
||||
{ import = 'user.plugin.lualine' },
|
||||
{ import = 'user.plugin.treesitter' },
|
||||
{ import = 'user.plugin.formatter' },
|
||||
{ import = 'user.plugin.go' },
|
||||
--{'fladson/vim-kitty', lazy=true, },
|
||||
|
||||
-- Navigation --
|
||||
{ import = 'user.plugin.neo-tree' },
|
||||
{ import = 'user.plugin.telescope' },
|
||||
|
||||
-- Utilities --
|
||||
{ import = 'user.plugin.comment' },
|
||||
{ import = 'user.plugin.noice' },
|
||||
{ import = 'user.plugin.swift' },
|
||||
{ import = 'user.plugin.toggleterm' },
|
||||
{ import = 'user.plugin.which-key' },
|
||||
{ import = 'user.plugin.wrapping' },
|
||||
{
|
||||
"folke/zen-mode.nvim",
|
||||
opts = { }
|
||||
},
|
||||
{
|
||||
"christoomey/vim-tmux-navigator",
|
||||
lazy = false,
|
||||
},
|
||||
{
|
||||
"NMAC427/guess-indent.nvim",
|
||||
opts = { }
|
||||
},
|
||||
})
|
||||
@@ -3,9 +3,9 @@ local wo = vim.wo
|
||||
local fn = vim.fn
|
||||
|
||||
vim.cmd.set('inccommand=split')
|
||||
o.updatetime = 300 -- faster completion
|
||||
o.timeoutlen = 400 -- time to wait for a mapped sequence to complete (in milliseconds)
|
||||
o.ttimeoutlen = 0 -- Time in milliseconds to wait for a key code sequence to complete
|
||||
o.updatetime = 500 -- faster completion
|
||||
o.timeoutlen = 800 -- time to wait for a mapped sequence to complete (in milliseconds)
|
||||
o.ttimeoutlen = 300 -- Time in milliseconds to wait for a key code sequence to complete
|
||||
o.backup = false -- creates a backup file
|
||||
o.swapfile = false -- enable/disable swap file creation
|
||||
o.dir = fn.stdpath("data") .. "/swp" -- swap file directory
|
||||
@@ -35,7 +35,7 @@ o.termguicolors = true -- set term gui colors (most terminals support this)
|
||||
o.cursorline = true -- highlight the current line
|
||||
o.scrolloff = 8 -- Minimal number of screen lines to keep above and below the cursor
|
||||
o.sidescrolloff = 5 -- The minimal number of columns to scroll horizontally
|
||||
o.hlsearch = true -- highlight all matches on previous search pattern
|
||||
o.hlsearch = false -- highlight all matches on previous search pattern
|
||||
o.ignorecase = true -- ignore case in search patterns
|
||||
o.foldenable = false -- disable folding; enable with zi
|
||||
o.foldmethod = "expr"
|
||||
@@ -45,7 +45,7 @@ o.listchars = "eol:¬,tab:>·,trail:~,extends:>,precedes:<,space:␣"
|
||||
o.shortmess = o.shortmess + "c" -- prevent "pattern not found" messages
|
||||
wo.colorcolumn = "99999"
|
||||
o.wildmode = "full"
|
||||
o.lazyredraw = true -- do not redraw screen while running macros
|
||||
o.lazyredraw = false -- do not redraw screen while running macros
|
||||
o.grepprg = "rg --hidden --vimgrep --smart-case --"
|
||||
o.completeopt = {"menu", "menuone", "noselect", "noinsert"} -- A comma separated list of options for Insert mode completion
|
||||
o.wildignorecase = true -- When set case is ignored when completing file names and directories
|
||||
9
nvim/m-housh/lua/user/snippets/init.lua
Normal file
9
nvim/m-housh/lua/user/snippets/init.lua
Normal file
@@ -0,0 +1,9 @@
|
||||
local ls = require('luasnip')
|
||||
local s = ls.snippet
|
||||
local sn = ls.snippet_node
|
||||
local ms = ls.multi_snippet
|
||||
local i = ls.insert_node
|
||||
local f = ls.function_node
|
||||
local c = ls.choice_node
|
||||
local t = ls.text_node
|
||||
|
||||
3
nvim/m-housh/lua/user/theme.lua
Normal file
3
nvim/m-housh/lua/user/theme.lua
Normal file
@@ -0,0 +1,3 @@
|
||||
-- Nightfox
|
||||
require('nightfox').load('terrafox')
|
||||
|
||||
11
nvim/m-housh/spell/en.utf-8.add
Normal file
11
nvim/m-housh/spell/en.utf-8.add
Normal file
@@ -0,0 +1,11 @@
|
||||
MeasureQuick
|
||||
Housh
|
||||
sealtite
|
||||
Subcool
|
||||
OEM
|
||||
NEC
|
||||
AHJ
|
||||
CFM
|
||||
Hydronic
|
||||
subpar
|
||||
quo
|
||||
BIN
nvim/m-housh/spell/en.utf-8.add.spl
Normal file
BIN
nvim/m-housh/spell/en.utf-8.add.spl
Normal file
Binary file not shown.
2
scripts/scripts/--help
Executable file
2
scripts/scripts/--help
Executable file
@@ -0,0 +1,2 @@
|
||||
#!/bin/zsh
|
||||
|
||||
2
scripts/scripts/-h
Executable file
2
scripts/scripts/-h
Executable file
@@ -0,0 +1,2 @@
|
||||
#!/bin/zsh
|
||||
|
||||
@@ -1,4 +0,0 @@
|
||||
#!/bin/sh
|
||||
|
||||
# makes files executable
|
||||
test -f "$1" && chmod +x "$1"
|
||||
@@ -1,5 +0,0 @@
|
||||
#!/bin/sh
|
||||
|
||||
for file in "$SCREENSHOTS"/*; do
|
||||
rm "$file"
|
||||
done
|
||||
@@ -1,4 +1,4 @@
|
||||
#!/bin/bash
|
||||
#!/bin/zsh
|
||||
|
||||
# adapted from...
|
||||
# https://github.com/rwxrob/dot/blob/main/scripts/cmt
|
||||
|
||||
@@ -1,17 +0,0 @@
|
||||
#!/bin/sh
|
||||
|
||||
# Creates an encrypted disk image from a folder
|
||||
|
||||
set -e
|
||||
|
||||
from="$1"
|
||||
to="$2"
|
||||
|
||||
if [ -z "$1" ] || [ -z "$2" ]; then
|
||||
echo "Usage: dmg <fromdir> <todir>"
|
||||
echo ""
|
||||
exit 1
|
||||
fi
|
||||
|
||||
name="$(isosec).dmg"
|
||||
hdiutil create -encryption AES-256 -srcfolder "$from" "$to/$name"
|
||||
@@ -1,9 +1,4 @@
|
||||
#!/bin/sh
|
||||
|
||||
set -e
|
||||
date -u '+%Y%m%d%H%M%S'
|
||||
|
||||
isosec() {
|
||||
echo "$(date -u '+%Y%m%d%H%M%S')"
|
||||
}
|
||||
|
||||
isosec
|
||||
|
||||
@@ -1,5 +0,0 @@
|
||||
#!/bin/bash
|
||||
|
||||
# Lists files and directories, including hidden files.
|
||||
|
||||
ls -lah --color "$@"
|
||||
66
scripts/scripts/mhlink
Executable file
66
scripts/scripts/mhlink
Executable file
@@ -0,0 +1,66 @@
|
||||
#!/usr/bin/env zsh
|
||||
|
||||
# Generates a link to my website / blog.
|
||||
#
|
||||
# Use the -l | --last option to generate a link based on the most
|
||||
# recent page-bundle created (this does not work if the post has been
|
||||
# sitting around / worked on for a bit).
|
||||
#
|
||||
# If no option is passed in then it will open an fzf (fuzzy search)
|
||||
# from the directories.
|
||||
#
|
||||
# Use the --local option to generate a link to a version running on localhost.
|
||||
#
|
||||
# A general usage to generate a link and copy it to the clipboard:
|
||||
#
|
||||
# `$ mhlink --last | pbcopy`
|
||||
#
|
||||
#
|
||||
|
||||
#################### Options ####################
|
||||
lastOpt=
|
||||
localOpt=
|
||||
|
||||
zparseopts -- \
|
||||
{l,-last}=lastOpt \
|
||||
-local=localOpt
|
||||
|
||||
#################### Main ####################
|
||||
|
||||
if [ -d "$GHREPOS/mhoush.com" ]; then
|
||||
root="$$GHREPOS/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
|
||||
|
||||
# Get's all the directories / page-bundles.
|
||||
posts=$(find "$postsPath" -mindepth 1 -maxdepth 1 -type d -print0 | \
|
||||
xargs -0 stat -f"%m %Sm %N" | \
|
||||
sort -rn)
|
||||
|
||||
# Use the last directory or choose from a list.
|
||||
[ -n "$lastOpt" ] \
|
||||
&& choice=$(echo $posts | tr '\n' ' ' | cut -w -f6) \
|
||||
|| choice=$(echo $posts | fzf)
|
||||
|
||||
# Delete everything before the last /
|
||||
choice="${choice##*/}"
|
||||
|
||||
# Exit if a choice was not made / found.
|
||||
[ -z $choice ] \
|
||||
&& echo "No selection made." \
|
||||
&& exit 1
|
||||
|
||||
# Set the prefix / website according to the options.
|
||||
[ -n "$localOpt" ] \
|
||||
&& prefix="http://localhost:1313" \
|
||||
|| prefix="https://mhoush.com"
|
||||
|
||||
echo "$prefix/$choice/"
|
||||
@@ -1,12 +0,0 @@
|
||||
#!/bin/sh
|
||||
|
||||
# Creates a directory then `cd`'s into the directory
|
||||
|
||||
set -e
|
||||
|
||||
dir="$1"
|
||||
|
||||
test -n "${dir}" || echo "usage: mkcd <dir>" && exit 1
|
||||
|
||||
mkdir "${dir}"
|
||||
cd "${dir}"
|
||||
25
scripts/scripts/mkhpadir
Executable file
25
scripts/scripts/mkhpadir
Executable file
@@ -0,0 +1,25 @@
|
||||
#!/bin/zsh
|
||||
|
||||
# Creates a new home performance assesment directory, from the skeleton
|
||||
# directory.
|
||||
|
||||
sdate="$(date '+%Y.%m.%d' | cut -c3-)"
|
||||
customerName="$1"
|
||||
dirName="${sdate}.${customerName}_HPA"
|
||||
skelPath="$SKELETONDIR/hpa"
|
||||
|
||||
#-------------------- MAIN --------------------
|
||||
|
||||
if [ -z $customerName ]; then
|
||||
echo "Customer name should not be empty." && exit 1
|
||||
fi
|
||||
|
||||
if [ ! -d $skelPath ]; then
|
||||
echo "Could not find skeleton directory." && exit 1
|
||||
fi
|
||||
|
||||
if [ ! -d $PROPOSALS ]; then
|
||||
echo "Could not find proposals directory." && exit 1
|
||||
fi
|
||||
|
||||
cp -R "$skelPath" "$PROPOSALS/$dirName"
|
||||
147
scripts/scripts/mktrans
Executable file
147
scripts/scripts/mktrans
Executable file
@@ -0,0 +1,147 @@
|
||||
#!/bin/bash
|
||||
# B9 June 2017
|
||||
|
||||
# mktrans
|
||||
# This is similar to ImageMagick's bg_removal script, but much higher
|
||||
# quality. (It's also faster and simpler to use.)
|
||||
#
|
||||
# For a sample, run these commands:
|
||||
# convert logo: logo.png
|
||||
# mktrans logo.png
|
||||
# display logo-transparent.png
|
||||
|
||||
|
||||
# Fuzz is how far off the background color can be (in percent).
|
||||
# This is important for getting good antialiasing.
|
||||
defaultfuzz=20
|
||||
|
||||
usage() {
|
||||
cat <<EOF
|
||||
|
||||
mktrans: Convert images into shaped transparent pngs by floodfilling
|
||||
the background with transparency (antialiased alpha channel).
|
||||
Unless a different starting pixel is specified, the top left
|
||||
pixel is used as the "background" color to remove and
|
||||
floodfill starts from all four image edges,
|
||||
|
||||
Typical usage:
|
||||
|
||||
mktrans foo.jpg (creates foo-transparent.png)
|
||||
|
||||
Usage: mktrans [-f <fuzz>] [-s|-S] [-p <x>,<y>] [-v] <files ... >
|
||||
|
||||
-f <fuzz>: How loosely to match the background color (default $defaultfuzz%)
|
||||
|
||||
Advanced options:
|
||||
-s: Use speedy antialiasing (much faster, slightly less acurate)
|
||||
-S: Supress antialiasing completely. (Useful for repeated runs)
|
||||
p <x>,<y>: Floodfill from pixel at x,y instead of 0,0
|
||||
-v: Verbose
|
||||
EOF
|
||||
|
||||
# * Side note: This creates an antialiased (blurred) alpha channel
|
||||
# that is also eroded by half a pixel to avoid halos. ImageMagick's
|
||||
# morphological operations don't (yet?) work at the subpixel level,
|
||||
# so I'm blowing up the alpha channel to 200% before eroding. Since
|
||||
# this can be slow on large images, consider using the '-s' option
|
||||
# which uses a faster, lower quality antialiasing.
|
||||
|
||||
# * Running this script on an image that already has transparency will
|
||||
# erode the image due to the antialiasing. Using -S is a workaround,
|
||||
# but is not very satisfactory. Perhaps this script should remove any
|
||||
# existing transparency before manipulating the image and then add it
|
||||
# back in at the end. But then again, how often are people going to
|
||||
# want to do that? The only use I can think of is when using -p.
|
||||
|
||||
# * Because of the previous bug, if you do use -p to fill lots of
|
||||
# lagoons, you'll probably want to use -A at the same time.
|
||||
|
||||
# * Finding the coordinates for -p is a pain. It'd be nice if there was
|
||||
# a -P option which let the user click on a point (or multiple points)
|
||||
# in the image to start the floodfill.
|
||||
|
||||
exit 0
|
||||
}
|
||||
|
||||
fuzz=$defaultfuzz
|
||||
pixelcomma="0,0"
|
||||
pixelplus="+0+0"
|
||||
|
||||
while getopts f:sAShp:v name; do
|
||||
case $name in
|
||||
f) fuzz=$OPTARG
|
||||
;;
|
||||
s) sflag=True
|
||||
;;
|
||||
S|A) noantialias=True
|
||||
;;
|
||||
v) vflag=True
|
||||
;;
|
||||
h) usage
|
||||
;;
|
||||
p) pixelcomma=$OPTARG
|
||||
pixelplus=+${OPTARG%,*}+${OPTARG#*,}
|
||||
pflag=True
|
||||
;;
|
||||
*) usage
|
||||
;;
|
||||
esac
|
||||
done
|
||||
|
||||
shift $((OPTIND-1))
|
||||
[[ "$#" != 0 ]] || usage
|
||||
|
||||
|
||||
for filename; do
|
||||
# Get color of 0,0 (top left) pixel
|
||||
color=$(convert "$filename" -format "%[pixel:p{$pixelcomma}]" info:-)
|
||||
if [[ "$color" == *rgba*",0)" ]]; then
|
||||
color="${color%,0)},1)" # Floodfill only works with opaque colors.
|
||||
fi
|
||||
if [[ "$color" == "none" ]]; then
|
||||
echo "Error: $filename: pixel at $pixelcomma is completely transparent. Cannot floodfill." >&2
|
||||
continue
|
||||
fi
|
||||
|
||||
options=""
|
||||
if [ -z "$pflag" ]; then
|
||||
# Add a 1 pixel border so we'll fill from the bottom and sides as well.
|
||||
options+=" -bordercolor $color -border 1 "
|
||||
fi
|
||||
# In a new stack, make a copy of the image
|
||||
options+=" ( +clone "
|
||||
# [copy] floodfill with transparency ("none") starting at top-left
|
||||
options+=" -fuzz $fuzz% -fill none -floodfill $pixelplus $color"
|
||||
# [copy] extract just the transparency (alpha channel)
|
||||
options+=" -alpha extract"
|
||||
|
||||
if [ -z "$noantialias" ]; then
|
||||
if [ -z "$sflag" ]; then
|
||||
# [copy] blow up the alpha channel so we can do sub-pixel morphology
|
||||
options+=" -geometry 200%"
|
||||
# [copy] blur the alpha channel to make it antialiased
|
||||
options+=" -blur 0x0.5"
|
||||
# [copy] shrink the region that is opaque by half a pixel.
|
||||
options+=" -morphology erode square:1"
|
||||
# [copy] scale the alpha channel back to normal size.
|
||||
options+=" -geometry 50%"
|
||||
else # sflag: speedy antialias
|
||||
# [copy] blur the alpha channel to make it antialiased
|
||||
options+=" -blur 0x1"
|
||||
# [copy] only antialias inside the figure (<50% opacity becomes 0%)
|
||||
options+=" -level 50%,100%"
|
||||
fi
|
||||
fi
|
||||
# [copy] end the stack.
|
||||
options+=" ) "
|
||||
# Compose the original image and the copy's alpha channel.
|
||||
options+=" -compose CopyOpacity -composite"
|
||||
if [ -z "$pflag" ]; then
|
||||
# Remove the 1 pixel border we added
|
||||
options+=" -shave 1"
|
||||
fi
|
||||
|
||||
[ "$vflag" ] && echo convert "$filename" $options "${filename%.*}-transparent.png"
|
||||
|
||||
convert "$filename" $options "${filename%.*}-transparent.png"
|
||||
done
|
||||
@@ -2,10 +2,10 @@
|
||||
|
||||
set -e
|
||||
|
||||
# Creates a new `zet` inside the House Call Pro `Zettlekasten`
|
||||
# Creates a new `zet` inside the NCI Summit `Zettlekasten`
|
||||
|
||||
_main() {
|
||||
(ZETDIR="$HOME/Documents/NCISummit" eval zet "$@")
|
||||
ZETDIR="$HOME/Documents/NCISummit" eval zet "$@"
|
||||
}
|
||||
|
||||
_main "$@"
|
||||
|
||||
@@ -1,26 +1,98 @@
|
||||
#!/bin/sh
|
||||
#!/bin/zsh
|
||||
|
||||
# Creates a new executable file in the $SCRIPTS directory.
|
||||
# Creates a new executable file.
|
||||
|
||||
# check if the scripts path / environment variable is set
|
||||
test ! -n "${SCRIPTS}" && echo "SCRIPTS not set" && exit 1;
|
||||
declare -a localOpt
|
||||
declare -a functionOpt
|
||||
declare -a shellOpt=("zsh")
|
||||
declare -a helpOpt
|
||||
DEBUG="$(env | grep DEBUG)"
|
||||
|
||||
# fallback to check if the name arg ${1} exists, if not show usage text.
|
||||
test ! -n "${1}" && \
|
||||
echo "usage: newscript <name> <optional: shell>" && \
|
||||
echo "shell defaults to sh if not supplied" && \
|
||||
exit 1;
|
||||
zparseopts -D -K -- \
|
||||
{l,-local}+:=localOpt \
|
||||
{f,-function}+:=functionOpt \
|
||||
{s,-shell}+=shellOpt \
|
||||
{h,-help}=helpOpt
|
||||
|
||||
path="${SCRIPTS}/${1}"
|
||||
shell="${2:-sh}"
|
||||
shell=${shellOpt[-1]}
|
||||
localPath=${localOpt[-1]}
|
||||
|
||||
if [ -e "${path}" ]; then
|
||||
echo "Already exists try:"
|
||||
echo "vi ${path}"
|
||||
exit 1
|
||||
#-------------------- Helpers --------------------
|
||||
function usage() {
|
||||
cat << EOF
|
||||
newx: Create new executable (script, function, or local script).
|
||||
|
||||
Typical usage:
|
||||
|
||||
newx foo (creates new script named 'foo')
|
||||
|
||||
Usage: newx [-l <name>] [-f <name>] [-s <shell>]
|
||||
|
||||
-l | --local <name>: Create a script in current directory.
|
||||
-f | --function <name>: Create a function.
|
||||
|
||||
Advanced options:
|
||||
-s | --shell <shell>: Customize the shell for the script.
|
||||
EOF
|
||||
|
||||
}
|
||||
|
||||
function debug_print() {
|
||||
[ -n "$DEBUG" ] \
|
||||
&& echo "DEBUG: $1"
|
||||
}
|
||||
|
||||
function create_script() {
|
||||
|
||||
local script_path="$1"
|
||||
|
||||
debug_print "shell: $shell"
|
||||
debug_print "script-path: $script_path"
|
||||
|
||||
printf "#!/bin/%s\n\n" "${shell}" > "${script_path}"
|
||||
chmod +x "${script_path}"
|
||||
exec "${EDITOR}" +2 "${script_path}"
|
||||
}
|
||||
|
||||
function parse_local_path() {
|
||||
if [ -z "$localPath" ]; then
|
||||
local prefix="${1[1]}${1[2]}"
|
||||
debug_print "prefix: $prefix"
|
||||
[ "$prefix" = "./" ] && localPath="$1"
|
||||
fi
|
||||
}
|
||||
|
||||
#-------------------- Main --------------------
|
||||
|
||||
debug_print "first-arg: $1"
|
||||
|
||||
if [ -n "${helpOpt}" ]; then
|
||||
usage && exit 0
|
||||
fi
|
||||
|
||||
printf "#!/bin/%s\n\n" "${shell}" > "${path}"
|
||||
chmod +x "${path}"
|
||||
exec vim +2 "${path}"
|
||||
if [ -n "${functionOpt[-1]}" ]; then
|
||||
debug_print "function-opt: $functionOpt"
|
||||
|
||||
[ ! -d "$ZFUNCDIR" ] \
|
||||
&& echo "Function directory not found" \
|
||||
&& return 1
|
||||
|
||||
create_script "$ZFUNCDIR/${functionOpt[-1]}"
|
||||
return 0
|
||||
fi
|
||||
|
||||
parse_local_path "$1"
|
||||
|
||||
if [ -n "$localPath" ]; then
|
||||
debug_print "local: $localPath"
|
||||
create_script "$localPath"
|
||||
return 0
|
||||
fi
|
||||
|
||||
debug_print "scripts: $1"
|
||||
[ ! -d "$SCRIPTS" ] \
|
||||
&& echo "Scripts directory not found. Set the SCRIPTS environment variable." \
|
||||
&& return 1
|
||||
|
||||
create_script "${SCRIPTS}/$1"
|
||||
|
||||
|
||||
22
scripts/scripts/nvims
Executable file
22
scripts/scripts/nvims
Executable file
@@ -0,0 +1,22 @@
|
||||
#!/bin/zsh
|
||||
|
||||
# Change / select an nvim configuration.
|
||||
#
|
||||
# The configuration's need to be in the ~/.config folder
|
||||
# to work properly.
|
||||
#
|
||||
main() {
|
||||
items=("default" "m-housh" "kickstart" "lazy")
|
||||
config=$(printf "%s\n" "${items[@]}" \
|
||||
| fzf --prompt=" Neovim Config ➣ " --height=50% --layout=reverse --border --exit-0
|
||||
)
|
||||
if [ -z "$config" ]; then
|
||||
echo "Nothing selected"
|
||||
return 0
|
||||
elif [ $config == "default" ]; then
|
||||
config=""
|
||||
fi
|
||||
unset VIMINIT && unset MYVIMRC && export NVIM_APPNAME=$config && nvim $@
|
||||
}
|
||||
|
||||
main "$@"
|
||||
94
scripts/scripts/post-to-facebook
Executable file
94
scripts/scripts/post-to-facebook
Executable file
@@ -0,0 +1,94 @@
|
||||
#!/usr/bin/env zsh
|
||||
|
||||
# Posts to facebook group and personal page.
|
||||
#
|
||||
# Typical usage would be to generate a link to the latest
|
||||
# blog post and send to facebook:
|
||||
#
|
||||
# `$ mhlink --last | xargs -I {} post-to-facebook -m <optional-message> {}`
|
||||
#
|
||||
#
|
||||
|
||||
#################### Options ####################
|
||||
declare -a message
|
||||
|
||||
zparseopts -D -F -K -- \
|
||||
{a,-all}=locationOpt \
|
||||
{m,-message}+:=message \
|
||||
{o,-offline}=offline \
|
||||
{p,-personal}=locationOpt \
|
||||
{h,-help}=help
|
||||
|
||||
baseUrl="https://graph.facebook.com/v18.0"
|
||||
link=$1
|
||||
message="${message[-1]}"
|
||||
token=$(cat < "$HOME/.config/facebook-bot/access-token.txt")
|
||||
|
||||
#################### Usage ####################
|
||||
function usage() {
|
||||
cat <<EOF
|
||||
|
||||
post-to-facebook: Create posts on facebook using. This accepts
|
||||
a link as an argument and a message option. Either the message
|
||||
or the link (or both) needs to be supplied.
|
||||
|
||||
Typical usage:
|
||||
|
||||
post-to-facebook --message "Some message" "https://mhouhs.com/<post>"
|
||||
|
||||
Usage: post-to-facebook [-a] [-m <message>] [-o] [-p] <link>
|
||||
|
||||
-a | --all: Send the post to the group and personal pages.
|
||||
-m | --message: The optional message.
|
||||
-o | --offline: Do not send the request(s), but print them.
|
||||
-p | --personal: Send to personal page only.
|
||||
-h | --help: Show the usage.
|
||||
|
||||
The -a or -p options are optional, if neither is supplied then it will
|
||||
only be posted to the group.
|
||||
|
||||
EOF
|
||||
}
|
||||
|
||||
#################### Helpers ####################
|
||||
|
||||
function post() {
|
||||
local url=$1
|
||||
if [ -n "$offline" ]; then
|
||||
echo "Offline mode, request not being sent."
|
||||
http --offline --ignore-stdin POST "$url" access_token=="$token" \
|
||||
link="$link" \
|
||||
message="$message"
|
||||
else
|
||||
http --ignore-stdin POST "$url" access_token=="$token" \
|
||||
link="$link" \
|
||||
message="$message"
|
||||
fi
|
||||
}
|
||||
|
||||
function post_to_group() {
|
||||
group=$(cat < "$HOME/.config/facebook-bot/group.txt")
|
||||
post "$baseUrl/$group/feed"
|
||||
}
|
||||
|
||||
function post_to_personal() {
|
||||
post "$baseUrl/me/feed"
|
||||
}
|
||||
|
||||
#################### Main ####################
|
||||
|
||||
[ -n "$help" ] && usage && exit 0
|
||||
|
||||
[ -z "$link" ] && [ -z "$message" ] \
|
||||
&& echo "Link or message is required." \
|
||||
&& exit 1
|
||||
|
||||
[ "$locationOpt" = "-p" ] || [ "$locationOpt" = "--personal" ] \
|
||||
&& post_to_personal \
|
||||
&& exit 0
|
||||
|
||||
[ "$locationOpt" = "-a" ] || [ "$locationOpt" = "--all" ] \
|
||||
&& post_to_personal
|
||||
|
||||
post_to_group
|
||||
|
||||
@@ -1,4 +0,0 @@
|
||||
#!/bin/zsh
|
||||
|
||||
# Move into the proposals directory
|
||||
cd "$HOME/Library/Mobile Documents/com~apple~CloudDocs/Work/Proposals"
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
set -e
|
||||
|
||||
# Creates a new `zet` inside the House Call Pro `Zettlekasten`
|
||||
# Creates a new `zet` inside the private `Zettlekasten`
|
||||
|
||||
_main() {
|
||||
(ZETDIR="$GHREPOS/private-zets" eval zet "$@")
|
||||
|
||||
85
scripts/scripts/tmux-sessionator
Executable file
85
scripts/scripts/tmux-sessionator
Executable file
@@ -0,0 +1,85 @@
|
||||
#!/usr/bin/env zsh
|
||||
|
||||
# Adapted from: https://github.com/ThePrimeagen/.dotfiles/blob/master/bin/.local/scripts/tmux-sessionizer
|
||||
|
||||
DEBUG=
|
||||
|
||||
#################### Options ####################
|
||||
|
||||
declare -a paths=()
|
||||
declare chooseOpt=
|
||||
|
||||
zparseopts -D -- \
|
||||
{c,-choose}=chooseOpt
|
||||
|
||||
#################### Helpers ####################
|
||||
|
||||
function debug_print {
|
||||
if [ -n "$DEBUG" ]; then
|
||||
echo "DEBUG: $1"
|
||||
fi
|
||||
}
|
||||
|
||||
|
||||
function path_prepend() {
|
||||
declare arg
|
||||
for arg in "$@"; do
|
||||
debug_print "arg: $arg"
|
||||
# Check that arg is a directory but not a symlink
|
||||
# Bc on some of my machines ~/projects is a symlink to $REPOS
|
||||
test -d $arg && ! test -L $arg || continue
|
||||
paths=($arg $paths)
|
||||
done
|
||||
}
|
||||
|
||||
function setup_fuzzy_find_paths() {
|
||||
path_prepend "$HOME" \
|
||||
"$HOME/projects" \
|
||||
"$REPOS/local" \
|
||||
$(find $REPOS/github.com -mindepth 1 -maxdepth 1 -type d -print 2> /dev/null)
|
||||
}
|
||||
|
||||
#################### MAIN ####################
|
||||
|
||||
declare choose="${chooseOpt[-1]}"
|
||||
|
||||
if [[ -n $choose ]]; then
|
||||
debug_print "Choose from existing."
|
||||
selected=$(
|
||||
tmux list-sessions -F \#S | gum filter \
|
||||
--placeholder "Pick a session..."
|
||||
)
|
||||
elif [[ "$#" -eq 1 ]]; then
|
||||
debug_print "Using existing session: $1"
|
||||
selected=$1
|
||||
else
|
||||
setup_fuzzy_find_paths
|
||||
debug_print "fuzzy find paths: ${(@)paths}"
|
||||
|
||||
if [ -n "$DEBUG" ]; then
|
||||
debug_print "Exiting because in debug mode."
|
||||
exit 0
|
||||
fi
|
||||
|
||||
selected=$(find ${(@)paths} -mindepth 1 -maxdepth 1 -type d | fzf)
|
||||
fi
|
||||
|
||||
if [[ -z $selected ]]; then
|
||||
exit 0
|
||||
fi
|
||||
|
||||
selected_name=$(basename "$selected" | tr . _)
|
||||
tmux_running=$(pgrep tmux)
|
||||
|
||||
if [[ -z $TMUX ]] && [[ -z $tmux_running ]]; then
|
||||
tmux new-session -s "$selected_name" -c "$selected"
|
||||
exit 0
|
||||
fi
|
||||
|
||||
# Create a session if it doesn't exist.
|
||||
if ! tmux has-session -t "$selected_name" 2> /dev/null; then
|
||||
tmux new-session -ds "$selected_name" -c "$selected"
|
||||
fi
|
||||
|
||||
[ -z $TMUX ] && tmux attach -t "$selected_name" \
|
||||
|| tmux switch-client -t "$selected_name"
|
||||
@@ -1,5 +0,0 @@
|
||||
#!/bin/sh
|
||||
|
||||
# opens a shell command in vi
|
||||
cmd=$(command -v $1)
|
||||
test -n "$cmd" && vi "$cmd"
|
||||
BIN
skeleton/hpa/Questions.numbers
Executable file
BIN
skeleton/hpa/Questions.numbers
Executable file
Binary file not shown.
BIN
skeleton/hpa/Report.pages
Executable file
BIN
skeleton/hpa/Report.pages
Executable file
Binary file not shown.
68
skhd/skhdrc
Normal file
68
skhd/skhdrc
Normal file
@@ -0,0 +1,68 @@
|
||||
# This starting point was configured from: https://www.joshmedeski.com/posts/blazing-fast-window-management-on-macos/
|
||||
|
||||
# focus window
|
||||
alt - h : yabai -m window --focus west
|
||||
alt - j : yabai -m window --focus south
|
||||
alt - k : yabai -m window --focus north
|
||||
alt - l : yabai -m window --focus east
|
||||
|
||||
# swap managed window
|
||||
shift + alt - h : yabai -m window --swap west
|
||||
shift + alt - j : yabai -m window --swap south
|
||||
shift + alt - k : yabai -m window --swap north
|
||||
shift + alt - l : yabai -m window --swap east
|
||||
|
||||
# move managed window
|
||||
shift + alt + ctrl - h : yabai -m window --warp west
|
||||
shift + alt + ctrl - j : yabai -m window --warp south
|
||||
shift + alt + ctrl - k : yabai -m window --warp north
|
||||
shift + alt + ctrl - l : yabai -m window --warp east
|
||||
|
||||
# rotate tree
|
||||
alt - r : yabai -m space --rotate 90
|
||||
|
||||
# toggle window fullscreen zoom
|
||||
alt - f : yabai -m window --toggle zoom-fullscreen
|
||||
|
||||
# alt - s : yabai -m window --toggle
|
||||
alt - s : yabai -m window --toggle sticky;\
|
||||
yabai -m window --toggle topmost;\
|
||||
yabai -m window --toggle pip
|
||||
|
||||
# toggle padding and gap
|
||||
alt - g : yabai -m space --toggle padding; yabai -m space --toggle gap
|
||||
|
||||
# float / unfloat window and center on screen
|
||||
alt - t : yabai -m window --toggle float;\
|
||||
yabai -m window --grid 4:4:1:1:2:2
|
||||
|
||||
# toggle window split type
|
||||
alt - e : yabai -m window --toggle split
|
||||
|
||||
# balance size of windows
|
||||
shift + alt - 0 : yabai -m space --balance
|
||||
|
||||
# move window and focus desktop
|
||||
shift + alt - 1 : yabai -m window --space 1; yabai -m space --focus 1
|
||||
shift + alt - 2 : yabai -m window --space 2; yabai -m space --focus 2
|
||||
shift + alt - 3 : yabai -m window --space 3; yabai -m space --focus 3
|
||||
shift + alt - 4 : yabai -m window --space 4; yabai -m space --focus 4
|
||||
shift + alt - 5 : yabai -m window --space 5; yabai -m space --focus 5
|
||||
shift + alt - 6 : yabai -m window --space 6; yabai -m space --focus 6
|
||||
shift + alt - 7 : yabai -m window --space 7; yabai -m space --focus 7
|
||||
shift + alt - 8 : yabai -m window --space 8; yabai -m space --focus 8
|
||||
shift + alt - 9 : yabai -m window --space 9; yabai -m space --focus 9
|
||||
|
||||
|
||||
# create desktop, move window and follow focus - uses jq for parsing json (brew install jq)
|
||||
shift + alt - n : yabai -m space --create && \
|
||||
index="$(yabai -m query --spaces --display | jq 'map(select(."native-fullscreen" == 0))[-1].index')" && \
|
||||
yabai -m window --space "${index}" && \
|
||||
yabai -m space --focus "${index}"
|
||||
|
||||
# fast focus desktop
|
||||
alt - tab : yabai -m space --focus recent
|
||||
|
||||
# send window to monitor and follow focus
|
||||
shift + alt - n : yabai -m window --display next; yabai -m display --focus next
|
||||
shift + alt - p : yabai -m window --display previous; yabai -m display --focus previous
|
||||
201
tmux/tmux-powerline/config.sh
Normal file
201
tmux/tmux-powerline/config.sh
Normal file
@@ -0,0 +1,201 @@
|
||||
# Default configuration file for tmux-powerline.
|
||||
# Modeline {
|
||||
# vi: foldmarker={,} foldmethod=marker foldlevel=0 tabstop=4 filetype=sh
|
||||
# }
|
||||
|
||||
# General {
|
||||
# Show which segment fails and its exit code.
|
||||
export TMUX_POWERLINE_DEBUG_MODE_ENABLED="false"
|
||||
# Use patched font symbols.
|
||||
export TMUX_POWERLINE_PATCHED_FONT_IN_USE="true"
|
||||
|
||||
# The theme to use.
|
||||
export TMUX_POWERLINE_THEME="mhoush"
|
||||
# Overlay directory to look for themes. There you can put your own themes outside the repo. Fallback will still be the "themes" directory in the repo.
|
||||
export TMUX_POWERLINE_DIR_USER_THEMES="${XDG_CONFIG_HOME:-$HOME/.config}/tmux-powerline/themes"
|
||||
# Overlay directory to look for segments. There you can put your own segments outside the repo. Fallback will still be the "segments" directory in the repo.
|
||||
export TMUX_POWERLINE_DIR_USER_SEGMENTS="${XDG_CONFIG_HOME:-$HOME/.config}/tmux-powerline/segments"
|
||||
|
||||
# The initial visibility of the status bar. Can be {"on, off"}.
|
||||
export TMUX_POWERLINE_STATUS_VISIBILITY="on"
|
||||
# The status bar refresh interval in seconds.
|
||||
# Note that events that force-refresh the status bar (such as window renaming) will ignore this.
|
||||
export TMUX_POWERLINE_STATUS_INTERVAL="1"
|
||||
# The location of the window list. Can be {"absolute-centre, centre, left, right"}.
|
||||
# Note that "absolute-centre" is only supported on `tmux -V` >= 3.2.
|
||||
export TMUX_POWERLINE_STATUS_JUSTIFICATION="centre"
|
||||
|
||||
# The maximum length of the left status bar.
|
||||
export TMUX_POWERLINE_STATUS_LEFT_LENGTH="60"
|
||||
# The maximum length of the right status bar.
|
||||
export TMUX_POWERLINE_STATUS_RIGHT_LENGTH="90"
|
||||
|
||||
# Uncomment these if you want to enable tmux bindings for muting (hiding) one of the status bars.
|
||||
# E.g. this example binding would mute the left status bar when pressing <prefix> followed by Ctrl-[
|
||||
#export TMUX_POWERLINE_MUTE_LEFT_KEYBINDING="C-["
|
||||
#export TMUX_POWERLINE_MUTE_RIGHT_KEYBINDING="C-]"
|
||||
# }
|
||||
|
||||
# battery.sh {
|
||||
# How to display battery remaining. Can be {percentage, cute}.
|
||||
export TMUX_POWERLINE_SEG_BATTERY_TYPE="percentage"
|
||||
# How may hearts to show if cute indicators are used.
|
||||
export TMUX_POWERLINE_SEG_BATTERY_NUM_HEARTS="5"
|
||||
# }
|
||||
|
||||
# date.sh {
|
||||
# date(1) format for the date. If you don't, for some reason, like ISO 8601 format you might want to have "%D" or "%m/%d/%Y".
|
||||
export TMUX_POWERLINE_SEG_DATE_FORMAT="%F"
|
||||
# }
|
||||
|
||||
# disk_usage.sh {
|
||||
# Filesystem to retrieve disk space information. Any from the filesystems available (run "df | awk '{print }'" to check them).
|
||||
export TMUX_POWERLINE_SEG_DISK_USAGE_FILESYSTEM="/"
|
||||
# }
|
||||
|
||||
# earthquake.sh {
|
||||
# The data provider to use. Currently only "goo" is supported.
|
||||
export TMUX_POWERLINE_SEG_EARTHQUAKE_DATA_PROVIDER="goo"
|
||||
# How often to update the earthquake data in seconds.
|
||||
# Note: This is not an early warning detector, use this
|
||||
# to be informed about recent earthquake magnitudes in your
|
||||
# area. If this is too often, goo may decide to ban you form
|
||||
# their server
|
||||
export TMUX_POWERLINE_SEG_EARTHQUAKE_UPDATE_PERIOD="600"
|
||||
# Only display information when earthquakes are within this many minutes
|
||||
export TMUX_POWERLINE_SEG_EARTHQUAKE_ALERT_TIME_WINDOW="60"
|
||||
# Display time with this format
|
||||
export TMUX_POWERLINE_SEG_EARTHQUAKE_TIME_FORMAT='(%H:%M)'
|
||||
# Display only if magnitude is greater or equal to this number
|
||||
export TMUX_POWERLINE_SEG_EARTHQUAKE_MIN_MAGNITUDE="3"
|
||||
# }
|
||||
|
||||
# hostname.sh {
|
||||
# Use short or long format for the hostname. Can be {"short, long"}.
|
||||
export TMUX_POWERLINE_SEG_HOSTNAME_FORMAT="short"
|
||||
# }
|
||||
|
||||
# macos_notification_count.sh {
|
||||
# App ids to query in notification center, separated by space
|
||||
# To get the app id that is associated with a specific app run:
|
||||
# sqlite3 -list "/var/folders/f1/rvv29ht91w15bk13tdcd339m0000gn/0//com.apple.notificationcenter/db/db" 'select * from app_info'
|
||||
# The first column contains the app ids
|
||||
# "5" is the app id of Messages.app
|
||||
# Only "banner" notifications are supported (see settings in the notification center)
|
||||
export TMUX_POWERLINE_SEG_MACOS_NOTIFICATION_COUNT_APPIDS="5"
|
||||
# Notification symbol
|
||||
export TMUX_POWERLINE_SEG_MACOS_NOTIFICATION_COUNT_CHAR="💬"
|
||||
# }
|
||||
|
||||
# mailcount.sh {
|
||||
# Mailbox type to use. Can be any of {apple_mail, gmail, maildir, mbox, mailcheck}
|
||||
export TMUX_POWERLINE_SEG_MAILCOUNT_MAILBOX_TYPE=""
|
||||
|
||||
## Gmail
|
||||
# Enter your Gmail username here WITH OUT @gmail.com.( OR @domain)
|
||||
export TMUX_POWERLINE_SEG_MAILCOUNT_GMAIL_USERNAME=""
|
||||
# Google password. Recomenned to use application specific password (https://accounts.google.com/b/0/IssuedAuthSubTokens) Leave this empty to get password from OS X keychain.
|
||||
# For OSX users : MAKE SURE that you add a key to the keychain in the format as follows
|
||||
# Keychain Item name : http://<value-you-fill-in-server-variable-below>
|
||||
# Account name : <username-below>@<server-below>
|
||||
# Password : Your password ( Once again, try to use 2 step-verification and application-specific password)
|
||||
# See http://support.google.com/accounts/bin/answer.py?hl=en&answer=185833 for more info.
|
||||
export TMUX_POWERLINE_SEG_MAILCOUNT_GMAIL_PASSWORD=""
|
||||
# Domain name that will complete your email. For normal GMail users it probably is "gmail.com but can be "foo.tld" for Google Apps users.
|
||||
export TMUX_POWERLINE_SEG_MAILCOUNT_GMAIL_SERVER="gmail.com"
|
||||
# How often in minutes to check for new mails.
|
||||
export TMUX_POWERLINE_SEG_MAILCOUNT_GMAIL_INTERVAL="5"
|
||||
|
||||
## Maildir
|
||||
# Path to the maildir to check.
|
||||
export TMUX_POWERLINE_SEG_MAILCOUNT_MAILDIR_INBOX="/Users/michael/.mail/inbox/new"
|
||||
|
||||
## mbox
|
||||
# Path to the mbox to check.
|
||||
export TMUX_POWERLINE_SEG_MAILCOUNT_MBOX_INBOX=""
|
||||
|
||||
## mailcheck
|
||||
# Optional path to mailcheckrc
|
||||
export TMUX_POWERLINE_SEG_MAILCOUNT_MAILCHECKRC="/Users/michael/.mailcheckrc"
|
||||
# }
|
||||
|
||||
# now_playing.sh {
|
||||
# Music player to use. Can be any of {audacious, banshee, cmus, itunes, lastfm, mocp, mpd, mpd_simple, pithos, playerctl, rdio, rhythmbox, spotify, spotify_wine, file}.
|
||||
export TMUX_POWERLINE_SEG_NOW_PLAYING_MUSIC_PLAYER="spotify"
|
||||
# File to be read in case the song is being read from a file
|
||||
export TMUX_POWERLINE_SEG_NOW_PLAYING_FILE_NAME=""
|
||||
# Maximum output length.
|
||||
export TMUX_POWERLINE_SEG_NOW_PLAYING_MAX_LEN="40"
|
||||
# How to handle too long strings. Can be {trim, roll}.
|
||||
export TMUX_POWERLINE_SEG_NOW_PLAYING_TRIM_METHOD="trim"
|
||||
# Charcters per second to roll if rolling trim method is used.
|
||||
export TMUX_POWERLINE_SEG_NOW_PLAYING_ROLL_SPEED="2"
|
||||
|
||||
# Hostname for MPD server in the format "[password@]host"
|
||||
export TMUX_POWERLINE_SEG_NOW_PLAYING_MPD_HOST="localhost"
|
||||
# Port the MPD server is running on.
|
||||
export TMUX_POWERLINE_SEG_NOW_PLAYING_MPD_PORT="6600"
|
||||
# Song display format for mpd_simple. See mpc(1) for delimiters.
|
||||
export TMUX_POWERLINE_SEG_NOW_PLAYING_MPD_SIMPLE_FORMAT="%artist% - %title%"
|
||||
# Song display format for playerctl. see "Format Strings" in playerctl(1).
|
||||
export TMUX_POWERLINE_SEG_NOW_PLAYING_PLAYERCTL_FORMAT="{{ artist }} - {{ title }}"
|
||||
# Song display format for rhythmbox. see "FORMATS" in rhythmbox-client(1).
|
||||
export TMUX_POWERLINE_SEG_NOW_PLAYING_RHYTHMBOX_FORMAT="%aa - %tt"
|
||||
|
||||
# Last.fm
|
||||
# Set up steps for Last.fm
|
||||
# 1. Make sure jq(1) is installed on the system.
|
||||
# 2. Create a new API application at https://www.last.fm/api/account/create (name it tmux-powerline) and copy the API key and insert it below in the setting TMUX_POWERLINE_SEG_NOW_PLAYING_LASTFM_API_KEY
|
||||
# 3. Make sure the API can access your recently played song by going to you user privacy settings https://www.last.fm/settings/privacy and make sure "Hide recent listening information" is UNCHECKED.
|
||||
# Username for Last.fm if that music player is used.
|
||||
export TMUX_POWERLINE_SEG_NOW_PLAYING_LASTFM_USERNAME=""
|
||||
# API Key for the API.
|
||||
export TMUX_POWERLINE_SEG_NOW_PLAYING_LASTFM_API_KEY=""
|
||||
# How often in seconds to update the data from last.fm.
|
||||
export TMUX_POWERLINE_SEG_NOW_PLAYING_LASTFM_UPDATE_PERIOD="30"
|
||||
# Fancy char to display before now playing track
|
||||
export TMUX_POWERLINE_SEG_NOW_PLAYING_NOTE_CHAR="♫"
|
||||
# }
|
||||
|
||||
# pwd.sh {
|
||||
# Maximum length of output.
|
||||
export TMUX_POWERLINE_SEG_PWD_MAX_LEN="40"
|
||||
# }
|
||||
|
||||
# time.sh {
|
||||
# date(1) format for the time. Americans might want to have "%I:%M %p".
|
||||
export TMUX_POWERLINE_SEG_TIME_FORMAT="%I:%M %p"
|
||||
# }
|
||||
|
||||
# tmux_session_info.sh {
|
||||
# Session info format to feed into the command: tmux display-message -p
|
||||
# For example, if FORMAT is '[ #S ]', the command is: tmux display-message -p '[ #S ]'
|
||||
export TMUX_POWERLINE_SEG_TMUX_SESSION_INFO_FORMAT="#S:#I.#P"
|
||||
# }
|
||||
|
||||
# utc_time.sh {
|
||||
# date(1) format for the UTC time.
|
||||
export TMUX_POWERLINE_SEG_UTC_TIME_FORMAT="%H:%M %Z"
|
||||
# }
|
||||
|
||||
# vcs_branch.sh {
|
||||
# Max length of the branch name.
|
||||
export TMUX_POWERLINE_SEG_VCS_BRANCH_MAX_LEN="24"
|
||||
# }
|
||||
|
||||
# weather.sh {
|
||||
# The data provider to use. Currently only "yahoo" is supported.
|
||||
export TMUX_POWERLINE_SEG_WEATHER_DATA_PROVIDER="yrno"
|
||||
# What unit to use. Can be any of {c,f,k}.
|
||||
export TMUX_POWERLINE_SEG_WEATHER_UNIT="c"
|
||||
# How often to update the weather in seconds.
|
||||
export TMUX_POWERLINE_SEG_WEATHER_UPDATE_PERIOD="600"
|
||||
# Name of GNU grep binary if in PATH, or path to it.
|
||||
export TMUX_POWERLINE_SEG_WEATHER_GREP="grep"
|
||||
# Location of the JSON parser, jq
|
||||
export TMUX_POWERLINE_SEG_WEATHER_JSON="jq"
|
||||
# Your location
|
||||
# Latitude and Longtitude for use with yr.no
|
||||
TMUX_POWERLINE_SEG_WEATHER_LAT=""
|
||||
TMUX_POWERLINE_SEG_WEATHER_LON=""
|
||||
# }
|
||||
113
tmux/tmux-powerline/themes/mhoush.sh
Normal file
113
tmux/tmux-powerline/themes/mhoush.sh
Normal file
@@ -0,0 +1,113 @@
|
||||
# Default Theme
|
||||
|
||||
if patched_font_in_use; then
|
||||
TMUX_POWERLINE_SEPARATOR_LEFT_BOLD=""
|
||||
TMUX_POWERLINE_SEPARATOR_LEFT_THIN=""
|
||||
TMUX_POWERLINE_SEPARATOR_RIGHT_BOLD=""
|
||||
TMUX_POWERLINE_SEPARATOR_RIGHT_THIN=""
|
||||
else
|
||||
TMUX_POWERLINE_SEPARATOR_LEFT_BOLD="◀"
|
||||
TMUX_POWERLINE_SEPARATOR_LEFT_THIN="❮"
|
||||
TMUX_POWERLINE_SEPARATOR_RIGHT_BOLD="▶"
|
||||
TMUX_POWERLINE_SEPARATOR_RIGHT_THIN="❯"
|
||||
fi
|
||||
|
||||
TMUX_POWERLINE_DEFAULT_BACKGROUND_COLOR=${TMUX_POWERLINE_DEFAULT_BACKGROUND_COLOR:-'235'}
|
||||
TMUX_POWERLINE_DEFAULT_FOREGROUND_COLOR=${TMUX_POWERLINE_DEFAULT_FOREGROUND_COLOR:-'255'}
|
||||
|
||||
TMUX_POWERLINE_DEFAULT_LEFTSIDE_SEPARATOR=${TMUX_POWERLINE_DEFAULT_LEFTSIDE_SEPARATOR:-$TMUX_POWERLINE_SEPARATOR_RIGHT_BOLD}
|
||||
TMUX_POWERLINE_DEFAULT_RIGHTSIDE_SEPARATOR=${TMUX_POWERLINE_DEFAULT_RIGHTSIDE_SEPARATOR:-$TMUX_POWERLINE_SEPARATOR_LEFT_BOLD}
|
||||
|
||||
# See man tmux.conf for additional formatting options for the status line.
|
||||
# The `format regular` and `format inverse` functions are provided as conveniences
|
||||
|
||||
if [ -z $TMUX_POWERLINE_WINDOW_STATUS_CURRENT ]; then
|
||||
TMUX_POWERLINE_WINDOW_STATUS_CURRENT=(
|
||||
"#[$(format inverse)]" \
|
||||
"$TMUX_POWERLINE_DEFAULT_LEFTSIDE_SEPARATOR" \
|
||||
" #I#F " \
|
||||
"$TMUX_POWERLINE_SEPARATOR_RIGHT_THIN" \
|
||||
" #W " \
|
||||
"#[$(format regular)]" \
|
||||
"$TMUX_POWERLINE_DEFAULT_LEFTSIDE_SEPARATOR"
|
||||
)
|
||||
fi
|
||||
|
||||
if [ -z $TMUX_POWERLINE_WINDOW_STATUS_STYLE ]; then
|
||||
TMUX_POWERLINE_WINDOW_STATUS_STYLE=(
|
||||
"$(format regular)"
|
||||
)
|
||||
fi
|
||||
|
||||
if [ -z $TMUX_POWERLINE_WINDOW_STATUS_FORMAT ]; then
|
||||
TMUX_POWERLINE_WINDOW_STATUS_FORMAT=(
|
||||
"#[$(format regular)]" \
|
||||
" #I#{?window_flags,#F, } " \
|
||||
"$TMUX_POWERLINE_SEPARATOR_RIGHT_THIN" \
|
||||
" #W "
|
||||
)
|
||||
fi
|
||||
|
||||
# Format: segment_name background_color foreground_color [non_default_separator] [separator_background_color] [separator_foreground_color] [spacing_disable] [separator_disable]
|
||||
#
|
||||
# * background_color and foreground_color. Formats:
|
||||
# * Named colors (chech man page of tmux for complete list) e.g. black, red, green, yellow, blue, magenta, cyan, white
|
||||
# * a hexadecimal RGB string e.g. #ffffff
|
||||
# * 'default' for the defalt tmux color.
|
||||
# * non_default_separator - specify an alternative character for this segment's separator
|
||||
# * separator_background_color - specify a unique background color for the separator
|
||||
# * separator_foreground_color - specify a unique foreground color for the separator
|
||||
# * spacing_disable - remove space on left, right or both sides of the segment:
|
||||
# * "left_disable" - disable space on the left
|
||||
# * "right_disable" - disable space on the right
|
||||
# * "both_disable" - disable spaces on both sides
|
||||
# * - any other character/string produces no change to default behavior (eg "none", "X", etc.)
|
||||
#
|
||||
# * separator_disable - disables drawing a separator on this segment, very useful for segments
|
||||
# with dynamic background colours (eg tmux_mem_cpu_load):
|
||||
# * "separator_disable" - disables the separator
|
||||
# * - any other character/string produces no change to default behavior
|
||||
#
|
||||
# Example segment with separator disabled and right space character disabled:
|
||||
# "hostname 33 0 {TMUX_POWERLINE_SEPARATOR_RIGHT_BOLD} 33 0 right_disable separator_disable"
|
||||
#
|
||||
# Note that although redundant the non_default_separator, separator_background_color and
|
||||
# separator_foreground_color options must still be specified so that appropriate index
|
||||
# of options to support the spacing_disable and separator_disable features can be used
|
||||
|
||||
if [ -z $TMUX_POWERLINE_LEFT_STATUS_SEGMENTS ]; then
|
||||
TMUX_POWERLINE_LEFT_STATUS_SEGMENTS=(
|
||||
"tmux_session_info 148 234" \
|
||||
"hostname 33 0" \
|
||||
#"ifstat 30 255" \
|
||||
#"ifstat_sys 30 255" \
|
||||
#"lan_ip 24 255 ${TMUX_POWERLINE_SEPARATOR_RIGHT_THIN}" \
|
||||
#"wan_ip 24 255" \
|
||||
"vcs_branch 29 88" \
|
||||
"pwd 89 211" \
|
||||
#"vcs_compare 60 255" \
|
||||
"vcs_staged 64 255" \
|
||||
"vcs_modified 9 255" \
|
||||
#"vcs_others 245 0" \
|
||||
)
|
||||
fi
|
||||
|
||||
if [ -z $TMUX_POWERLINE_RIGHT_STATUS_SEGMENTS ]; then
|
||||
TMUX_POWERLINE_RIGHT_STATUS_SEGMENTS=(
|
||||
#"earthquake 3 0" \
|
||||
"macos_notification_count 29 255" \
|
||||
#"mailcount 9 255" \
|
||||
"now_playing 234 37" \
|
||||
#"cpu 240 136" \
|
||||
#"load 237 167" \
|
||||
#"tmux_mem_cpu_load 234 136" \
|
||||
"battery 137 127" \
|
||||
#"weather 37 255" \
|
||||
#"rainbarf 0 ${TMUX_POWERLINE_DEFAULT_FOREGROUND_COLOR}" \
|
||||
#"xkb_layout 125 117" \
|
||||
"date_day 235 136" \
|
||||
"date 235 136 ${TMUX_POWERLINE_SEPARATOR_LEFT_THIN}" \
|
||||
"time 235 136 ${TMUX_POWERLINE_SEPARATOR_LEFT_THIN}" \
|
||||
#"utc_time 235 136 ${TMUX_POWERLINE_SEPARATOR_LEFT_THIN}" \
|
||||
)
|
||||
fi
|
||||
@@ -1,12 +1,15 @@
|
||||
# Some tweaks to the status line
|
||||
set -g status-right "%H:%M"
|
||||
set -g window-status-current-style "underscore"
|
||||
set -g status-position "top"
|
||||
|
||||
# If running inside tmux ($TMUX is set), then change the status line to red
|
||||
%if #{TMUX}
|
||||
set -g status-bg red
|
||||
%endif
|
||||
|
||||
TMUX_FZF_OPTIONS="-p -w 60% -h 80% -m"
|
||||
|
||||
# Enable RGB colour if running in xterm(1)
|
||||
set-option -sa terminal-overrides ",xterm*:Tc"
|
||||
|
||||
@@ -33,6 +36,10 @@ set -g prefix C-a
|
||||
unbind C-b
|
||||
bind C-a send-prefix
|
||||
|
||||
set-window-option -g mode-keys vi
|
||||
bind -T copy-mode-vi v send-keys -X begin-selection
|
||||
bind -T copy-mode-vi y send-keys -X copy-pipe-and-cancel 'xclip -in -selection clipboard'
|
||||
|
||||
# Turn the mouse on, but without copy mode dragging
|
||||
set -g mouse on
|
||||
unbind -n MouseDrag1Pane
|
||||
@@ -47,7 +54,7 @@ bind m set monitor-activity
|
||||
bind y set synchronize-panes\; display 'synchronize-panes #{?synchronize-panes,on,off}'
|
||||
|
||||
# Better split pane
|
||||
bind | splitw -h
|
||||
bind \\ splitw -h
|
||||
bind - splitw -v
|
||||
|
||||
# Use Alt-arrow keys to navigate panes
|
||||
@@ -55,29 +62,28 @@ bind -n M-Left select-pane -L
|
||||
bind -n M-Right select-pane -R
|
||||
bind -n M-Up select-pane -U
|
||||
bind -n M-Down select-pane -D
|
||||
bind -T prefix j select-pane -D
|
||||
bind -T prefix k select-pane -U
|
||||
bind -T prefix h select-pane -L
|
||||
bind -T prefix l select-pane -R
|
||||
bind-key -r K kill-pane
|
||||
|
||||
# Use Shift-arrow keys to navigate windows.
|
||||
bind -n S-Left previous-window
|
||||
bind -n S-Right next-window
|
||||
bind -n M-h previous-window
|
||||
bind -n M-L next-window
|
||||
bind C-l send-keys 'C-l'
|
||||
|
||||
bind f run-shell "tmux display-popup -E -w 80% -h 80% ~/.local/scripts/tmux-sessionator"
|
||||
bind-key -r C run-shell -b "~/.local/scripts/tmux-sessionator ~/.dotfiles"
|
||||
bind S run-shell -b "~/.config/tmux/plugins/tmux-fzf/scripts/session.sh switch"
|
||||
|
||||
# reload new changes
|
||||
bind-key R source-file ~/.tmux.conf\; \display-message "source-file done"
|
||||
bind-key r source-file ~/.config/tmux/tmux.conf\; \display-message "source-file done"
|
||||
|
||||
######################################## Plugins ########################################
|
||||
set -g @plugin 'tmux-plugins/tpm'
|
||||
set -g @plugin 'tmux-plugins/tmux-sensible'
|
||||
set -g @plugin 'sainnhe/tmux-fzf'
|
||||
set -g @plugin 'erikw/tmux-powerline'
|
||||
set -g @plugin 'christoomey/vim-tmux-navigator'
|
||||
|
||||
# Create a single default session - because a session is created here, tmux
|
||||
# should be started with "tmux attach" rather than "tmux new"
|
||||
#new -d -s0 -nirssi 'exec irssi'
|
||||
#set -t0:0 monitor-activity on
|
||||
#set -t0:0 aggressive-resize on
|
||||
#neww -d -ntodo 'exec emacs ~/TODO'
|
||||
#setw -t0:1 aggressive-resize on
|
||||
#neww -d -nmutt 'exec mutt'
|
||||
#setw -t0:2 aggressive-resize on
|
||||
#neww -d
|
||||
#neww -d
|
||||
#neww -d
|
||||
# Needs to stay at the bottom.
|
||||
run '~/.config/tmux/plugins/tpm/tpm'
|
||||
40
wezterm/wezterm.lua
Normal file
40
wezterm/wezterm.lua
Normal file
@@ -0,0 +1,40 @@
|
||||
local wezterm = require('wezterm')
|
||||
local config = {}
|
||||
|
||||
if wezterm.config_builder then
|
||||
config = wezterm.config_builder()
|
||||
end
|
||||
|
||||
--config.color_scheme = 'rose-pine'
|
||||
config.color_scheme = 'terafox'
|
||||
config.colors = {
|
||||
background = "#131111"
|
||||
}
|
||||
|
||||
-- Font
|
||||
config.font = wezterm.font_with_fallback {
|
||||
'JetBrains Mono',
|
||||
'Inconsolata Nerd Font Mono',
|
||||
}
|
||||
config.font_size = 16.0
|
||||
|
||||
-- Window
|
||||
config.adjust_window_size_when_changing_font_size = false
|
||||
config.enable_scroll_bar = false
|
||||
config.window_padding = {
|
||||
left = 0,
|
||||
right = 0,
|
||||
top = 0,
|
||||
bottom = 0
|
||||
}
|
||||
config.window_close_confirmation = 'NeverPrompt'
|
||||
--config.window_decorations = 'TITLE'
|
||||
|
||||
-- Tab Bar
|
||||
config.show_tabs_in_tab_bar = true
|
||||
config.show_new_tab_button_in_tab_bar = false
|
||||
config.use_fancy_tab_bar = true
|
||||
config.tab_bar_at_bottom = true
|
||||
config.hide_tab_bar_if_only_one_tab = true
|
||||
|
||||
return config
|
||||
44
yabai/yabairc
Executable file
44
yabai/yabairc
Executable file
@@ -0,0 +1,44 @@
|
||||
sudo yabai --load-sa
|
||||
yabai -m signal --add event=dock_did_restart action="sudo yabai --load-sa"
|
||||
|
||||
# global settings
|
||||
yabai -m config mouse_follows_focus off
|
||||
yabai -m config focus_follows_mouse off
|
||||
yabai -m config window_origin_display default
|
||||
yabai -m config window_placement second_child
|
||||
yabai -m config window_topmost off
|
||||
yabai -m config window_shadow on
|
||||
yabai -m config window_opacity off
|
||||
yabai -m config window_opacity_duration 0.0
|
||||
yabai -m config active_window_opacity 1.0
|
||||
yabai -m config normal_window_opacity 0.90
|
||||
yabai -m config window_border off
|
||||
yabai -m config window_border_width 6
|
||||
yabai -m config active_window_border_color 0xff775759
|
||||
yabai -m config normal_window_border_color 0xff555555
|
||||
yabai -m config insert_feedback_color 0xffd75f5f
|
||||
yabai -m config split_ratio 0.50
|
||||
yabai -m config auto_balance off
|
||||
yabai -m config mouse_modifier fn
|
||||
yabai -m config mouse_action1 move
|
||||
yabai -m config mouse_action2 resize
|
||||
yabai -m config mouse_drop_action swap
|
||||
|
||||
# general space settings
|
||||
yabai -m config layout bsp
|
||||
yabai -m config top_padding 3
|
||||
yabai -m config bottom_padding 3
|
||||
yabai -m config left_padding 0
|
||||
# NOTE: for OBS floating head
|
||||
# yabai -m config left_padding 450
|
||||
yabai -m config right_padding 0
|
||||
yabai -m config window_gap 0
|
||||
|
||||
# apps to not manage (ignore)
|
||||
yabai -m rule --add app="^System Settings$" manage=off
|
||||
yabai -m rule --add app="^Archive Utility$" manage=off
|
||||
yabai -m rule --add app="^Logi Options$" manage=off
|
||||
yabai -m rule --add app="^Music$" manage=off
|
||||
yabai -m rule --add app="^pwSafe$" manage=off
|
||||
|
||||
echo "yabai configuration loaded.."
|
||||
4
zsh/.zshenv
Normal file
4
zsh/.zshenv
Normal file
@@ -0,0 +1,4 @@
|
||||
# This needs placed in the ~/.zshenv
|
||||
|
||||
export ZDOTDIR="$HOME/.config/zsh"
|
||||
[ -f "$ZDOTDIR/.zshenv" ] && source "$ZDOTDIR/.zshenv"
|
||||
@@ -1,2 +1,74 @@
|
||||
# Point to where the zsh config is.
|
||||
# This should be placed in "$XDG_CONFIG_HOME/zsh/.zshenv"
|
||||
|
||||
# XDG
|
||||
export XDG_CONFIG_HOME="$HOME/.config"
|
||||
export XDG_DATA_HOME="$HOME/.local"
|
||||
export XDG_STATE_HOME="$HOME/.local/state"
|
||||
export XDG_CACHE_HOME="$HOME/.cache"
|
||||
|
||||
# Config
|
||||
export ZDOTDIR="$HOME/.config/zsh"
|
||||
export ZFUNCDIR="$ZDOTDIR/functions"
|
||||
export SHELL="$(which zsh)"
|
||||
export TERM=xterm-256color
|
||||
export EDITOR=nvim
|
||||
export VISUAL=nvim
|
||||
export EDITOR_PREFIX=nvim
|
||||
#export VIMINIT='source $MYVIMRC'
|
||||
#export MYVIMRC="$HOME/.vim/vimrc"
|
||||
export NVIM_APPNAME="m-housh"
|
||||
|
||||
# Git
|
||||
export GITUSER="m-housh"
|
||||
export GIT_DISCOVERY_ACROSS_FILESYSTEM=1
|
||||
|
||||
# Directories
|
||||
export ARCHIVE="/Volumes/Archive"
|
||||
export BUCKET="/Volumes/Bucket"
|
||||
export REPOS="$BUCKET/Repos"
|
||||
export GHREPOS="$REPOS/github.com/$GITUSER"
|
||||
export HHEREPOS="$BUCKET/Repos/github.com/hhe-dev"
|
||||
export LOCAL_REPOS="$REPOS/local"
|
||||
export HCP_NOTES="$HHEREPOS/hcp-notes"
|
||||
export HXZET="$BUCKET/Repos/github.com/hvac-hx/hx-zets"
|
||||
export HAAS="$BUCKET/Repos/github.com/haas"
|
||||
export HAASZET="$HAAS/zets"
|
||||
export DOCUMENTS="$HOME/Documents"
|
||||
export DOWNLOADS="$HOME/Downloads"
|
||||
export PDFS="$HOME/Library/Mobile Documents/com~apple~Preview/Documents"
|
||||
export PROPOSALS="$HOME/Library/Mobile Documents/com~apple~CloudDocs/Work/Proposals"
|
||||
export SCREENSHOTS="$BUCKET/Pictures/Screenshots"
|
||||
export DOTFILES="$HOME/.dotfiles"
|
||||
export SCRIPTS="$HOME/.local/scripts"
|
||||
export WORK="$HOME/Library/Mobile Documents/com~apple~CloudDocs/Work"
|
||||
export ZETDIR="$GHREPOS/zets"
|
||||
export MYZSHRC="$ZDOTDIR/.zshrc"
|
||||
export NAP_CONFIG="$HOME/.config/nap/config.yaml"
|
||||
export SKELETONDIR="$DOTFILES/skeleton"
|
||||
|
||||
# NPM
|
||||
export NPM_CONFIG_CACHE="$HOME/.local/npm"
|
||||
export NPM_CONFIG_USERCONFIG="$XDG_CONFIG_HOME/npm/npmrc"
|
||||
|
||||
# Go
|
||||
export GOPATH="$XDG_DATA_HOME/go"
|
||||
|
||||
# Cabal
|
||||
export CABAL_CONFIG="$XDG_CONFIG_HOME/cabal/config"
|
||||
export CABAL_DIR="$XDG_DATA_HOME/cabal"
|
||||
|
||||
# Docker
|
||||
export DOCKER_CONFIG="$XDG_CONFIG_HOME/docker"
|
||||
|
||||
# Ruby
|
||||
export GEM_HOME="$XDG_DATA_HOME/gem"
|
||||
export GEM_SPEC_CACHE="$XDG_CACHE_HOME/gem"
|
||||
export BUNDLE_USER_CONFIG="$XDG_CONFIG_HOME/bundle"
|
||||
export BUNDLE_USER_CACHE="$XDG_CACHE_HOME/bundle"
|
||||
export BUNDLE_USER_PLUGIN="$XDG_DATA_HOME/bundle"
|
||||
|
||||
export LESSHISTFILE="$XDG_CACHE_HOME/less/history"
|
||||
export PSQL_HISTORY="$XDG_DATA_HOME/psql_history"
|
||||
|
||||
# Hashicorp/Vault
|
||||
export VAULT_ADDR="https://vault.housh.dev"
|
||||
|
||||
@@ -12,38 +12,6 @@
|
||||
_source_if() { test -r "$1" && source "$1" || return 0 }
|
||||
|
||||
#------------------------------ exports ------------------------------
|
||||
export ZDOTDIR="$HOME/.config/zsh"
|
||||
export SHELL="$(which zsh)"
|
||||
export GITUSER="m-housh"
|
||||
export BUCKET="/Volumes/Bucket"
|
||||
export ARCHIVE="/Volumes/Archive"
|
||||
export REPOS="$BUCKET/Repos"
|
||||
export GHREPOS="$REPOS/github.com/$GITUSER"
|
||||
export HHEREPOS="$BUCKET/Repos/github.com/hhe-dev"
|
||||
export LOCAL_REPOS="$REPOS/local"
|
||||
export HCP_NOTES="$HHEREPOS/hcp-notes"
|
||||
export ZETDIR="$GHREPOS/zets"
|
||||
export HXZET="$BUCKET/Repos/github.com/hvac-hx/hx-zets"
|
||||
export HAAS="$BUCKET/Repos/github.com/haas"
|
||||
export HAASZET="$HAAS/zets"
|
||||
export DOCUMENTS="$HOME/Documents"
|
||||
export DOWNLOADS="$HOME/Downloads"
|
||||
export PDFS="$HOME/Library/Mobile Documents/com~apple~Preview/Documents"
|
||||
export SCREENSHOTS="$BUCKET/Pictures/Screenshots"
|
||||
export DOTFILES="$HOME/.dotfiles"
|
||||
export DESKTOP="$HOME/Desktop"
|
||||
export SCRIPTS="$HOME/.local/scripts"
|
||||
export WORK="$HOME/Library/Mobile Documents/com~apple~CloudDocs/Work"
|
||||
export TERM=xterm-256color
|
||||
export EDITOR=vi
|
||||
export VISUAL=vi
|
||||
export EDITOR_PREFIX=vi
|
||||
export GIT_DISCOVERY_ACROSS_FILESYSTEM=1
|
||||
export VIMINIT='source $MYVIMRC'
|
||||
export MYVIMRC="$HOME/.vim/vimrc"
|
||||
export MYZSHRC="$ZDOTDIR/.zshrc"
|
||||
export PROPOSALS="$HOME/Library/Mobile Documents/com~apple~CloudDocs/Work/Proposals"
|
||||
|
||||
autoload -U up-line-or-beginning-search
|
||||
autoload -U down-line-or-beginning-search
|
||||
zle -N up-line-or-beginning-search
|
||||
@@ -52,7 +20,6 @@ zle -N down-line-or-beginning-search
|
||||
# Colors
|
||||
autoload -Uz colors && colors
|
||||
|
||||
|
||||
#------------------------------ pager ------------------------------
|
||||
export LESS_TERMCAP_mb="[35m" # magenta
|
||||
export LESS_TERMCAP_md="[33m" # yellow
|
||||
@@ -61,20 +28,10 @@ export LESS_TERMCAP_se=""
|
||||
export LESS_TERMCAP_so="[34m" # blue
|
||||
export LESS_TERMCAP_ue=""
|
||||
export LESS_TERMCAP_so="[4m" # underline
|
||||
export LESSHISTFILE="-"
|
||||
|
||||
#------------------------------ path ------------------------------
|
||||
|
||||
path_append() {
|
||||
declare arg
|
||||
for arg in "$@"; do
|
||||
test -d "$arg" || continue
|
||||
PATH=${PATH//":$arg:"/:}
|
||||
PATH=${PATH/#"$arg:"/}
|
||||
PATH=${PATH/%":$arg"/}
|
||||
export PATH="${PATH:+"$PATH:"}$arg"
|
||||
done
|
||||
} && export path_append
|
||||
|
||||
path_prepend() {
|
||||
declare arg
|
||||
for arg in "$@"; do
|
||||
@@ -97,12 +54,13 @@ fpath_prepend() {
|
||||
done
|
||||
} && export fpath_prepend
|
||||
|
||||
|
||||
# last arg will be first in path
|
||||
path_prepend \
|
||||
"/usr/local/bin" \
|
||||
"/opt/homebrew/bin" \
|
||||
"/opt/homebrew/sbin" \
|
||||
"$GOROOT/bin" \
|
||||
"$GOPATH/bin" \
|
||||
"$HOME/.local/bin" \
|
||||
"$SCRIPTS"
|
||||
|
||||
@@ -110,7 +68,10 @@ fpath_prepend \
|
||||
"$(brew --prefix)/share/zsh/site-functions" \
|
||||
"$(brew --prefix)/share/zsh-completions" \
|
||||
"$ZDOTDIR/completions" \
|
||||
"$HOME/.local/completions"
|
||||
"$HOME/.local/completions" \
|
||||
"$ZDOTDIR/functions"
|
||||
|
||||
autoload -Uz $fpath[1]/*(.:t)
|
||||
|
||||
#------------------------------ history ------------------------------
|
||||
setopt appendhistory # append to history
|
||||
@@ -120,6 +81,7 @@ setopt hist_expire_dups_first # expire duplicates first
|
||||
setopt hist_ignore_dups # do not store duplicates
|
||||
setopt hist_find_no_dups # ignore duplicates when searching
|
||||
setopt hist_reduce_blanks # do not store blank lines.
|
||||
setopt histignorespace # do not store commands that start with a space in history
|
||||
|
||||
export HISTSIZE=5000
|
||||
export HISTFILESIZE=10000
|
||||
@@ -150,7 +112,6 @@ export KEYTIMEOUT=1 # Switch between vim mode quicker.
|
||||
# Load Useful Functions
|
||||
_source_if "${ZDOTDIR}/zsh-functions"
|
||||
|
||||
|
||||
# Plugins
|
||||
zsh_add_plugin "zsh-users/zsh-autosuggestions"
|
||||
zsh_add_plugin "zsh-users/zsh-syntax-highlighting"
|
||||
@@ -176,7 +137,6 @@ prompt pure
|
||||
#------------------------------ aliases ------------------------------
|
||||
|
||||
alias bk='cd "${OLDPWD}"'
|
||||
alias cdots='cd "${DOTFILES}"'
|
||||
alias cl='printf "\e[H\e[2J"'
|
||||
alias clear='printf "\e[H\e[2J"'
|
||||
alias czets='cd "${ZETDIR}"'
|
||||
@@ -186,24 +146,25 @@ alias ga='git add'
|
||||
alias gcb='git checkout -b'
|
||||
alias gco='git checkout'
|
||||
alias gcm='git commit -a -m'
|
||||
#alias gma() { git add . && git commit -m "$1" }
|
||||
alias gp='git push'
|
||||
alias gs='git status'
|
||||
alias hn='hugo new'
|
||||
alias hnc='hugo new content'
|
||||
alias l='ls -lah --color=auto'
|
||||
alias reload='exec zsh -l'
|
||||
alias t='tmux'
|
||||
alias ts='~/.local/scripts/tmux-sessionator'
|
||||
alias tss='~/.local/scripts/tmux-sessionator --choose'
|
||||
alias tls='tmux list-sessions'
|
||||
alias temp='cd $(mktemp -d)'
|
||||
alias vi='vim'
|
||||
alias vi='nvim'
|
||||
alias newxf='~/.local/scripts/newx --function'
|
||||
alias nvim='unset VIMINIT && unset MYVIMRC && nvim'
|
||||
#------------------------------ functions ------------------------------
|
||||
mkcd() {
|
||||
local dir="$1"
|
||||
mkdir -p "$dir" && cd "$dir"
|
||||
} && export mkcd
|
||||
alias nvim-mhoush='NVIM_APPNAME=m-housh && nvim'
|
||||
alias nvim-kickstart='NVIM_APPNAME=kickstart nvim'
|
||||
alias nvim-lazy='NVIM_APPNAME=lazy nvim'
|
||||
alias wget="wget --hsts-file=$XDG_DATA_HOME/wget-hsts"
|
||||
|
||||
#------------------------------ local configs ------------------------------
|
||||
_source_if "$ZDOTDIR/.zshrc-local"
|
||||
|
||||
|
||||
# [ -f ~/.fzf.zsh ] && source ~/.fzf.zsh
|
||||
|
||||
test -d "$HOME/.tea" && source <("$HOME/.tea/tea.xyz/v*/bin/tea" --magic=zsh --silent)
|
||||
|
||||
6
zsh/config/functions/cdots
Executable file
6
zsh/config/functions/cdots
Executable file
@@ -0,0 +1,6 @@
|
||||
#!/usr/bin/env zsh
|
||||
|
||||
function cdots() {
|
||||
"$SCRIPTS/tmux-sessionator" "$DOTFILES"
|
||||
}
|
||||
|
||||
8
zsh/config/functions/chmox
Executable file
8
zsh/config/functions/chmox
Executable file
@@ -0,0 +1,8 @@
|
||||
#!/bin/zsh
|
||||
|
||||
# makes files executable
|
||||
|
||||
function chmox() {
|
||||
[ ! -f "$1" ] && echo "usage: chmox <file>" && return 1
|
||||
chmod u+x "$1"
|
||||
}
|
||||
7
zsh/config/functions/clean-screenshots
Executable file
7
zsh/config/functions/clean-screenshots
Executable file
@@ -0,0 +1,7 @@
|
||||
#!/bin/zsh
|
||||
|
||||
function clean-screenshots() {
|
||||
for file in "$SCREENSHOTS"/*; do
|
||||
rm "$file"
|
||||
done
|
||||
}
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user