Compare commits

...

10 Commits

16 changed files with 113 additions and 46 deletions

3
.gitmodules vendored
View File

@ -4,3 +4,6 @@
[submodule "zsh/custom/plugins/zsh-autosuggestions"]
path = zsh/custom/plugins/zsh-autosuggestions
url = https://github.com/zsh-users/zsh-autosuggestions/
[submodule "tmux/tpm"]
path = tmux/tpm
url = https://github.com/tmux-plugins/tpm

View File

@ -1,14 +1,15 @@
{
"Comment.nvim": { "branch": "master", "commit": "0236521ea582747b58869cb72f70ccfa967d2e89" },
"LuaSnip": { "branch": "master", "commit": "be7be2ca7f55bb881a7ffc16b2efa5af034ab06b" },
"LuaSnip": { "branch": "master", "commit": "03c8e67eb7293c404845b3982db895d59c0d1538" },
"bufferline.nvim": { "branch": "main", "commit": "243893ba9d5d1049dd451a25cab32ec7f8f67bcf" },
"bufresize.nvim": { "branch": "master", "commit": "3b19527ab936d6910484dcc20fb59bdb12322d8b" },
"cmp-nvim-lsp": { "branch": "main", "commit": "5af77f54de1b16c34b23cba810150689a3a90312" },
"cmp-path": { "branch": "main", "commit": "91ff86cd9c29299a64f968ebb45846c485725f23" },
"cmp_luasnip": { "branch": "master", "commit": "05a9ab28b53f71d1aece421ef32fee2cb857a843" },
"conform.nvim": { "branch": "master", "commit": "820eec990d5f332d30cf939954c8672a43a0459e" },
"conform.nvim": { "branch": "master", "commit": "a6965ac128eba75537ec2bc5ddd5d5e357062bdc" },
"document-color.nvim": { "branch": "main", "commit": "74c487f0e5accfaae033755451b9e367220693fd" },
"fidget.nvim": { "branch": "main", "commit": "1ba38e4cbb24683973e00c2e36f53ae64da38ef5" },
"gitsigns.nvim": { "branch": "main", "commit": "d96ef3bbff0bdbc3916a220f5c74a04c4db033f2" },
"gitsigns.nvim": { "branch": "main", "commit": "52f8da33cc0cadbf1164c4a91c8bfd6895533d67" },
"gruvbox.nvim": { "branch": "main", "commit": "6e4027ae957cddf7b193adfaec4a8f9e03b4555f" },
"guess-indent.nvim": { "branch": "main", "commit": "b8ae749fce17aa4c267eec80a6984130b94f80b2" },
"inc-rename.nvim": { "branch": "main", "commit": "5e03e986625961d1fac296d1bf332a6510c3add6" },
@ -20,7 +21,7 @@
"mason-lspconfig.nvim": { "branch": "main", "commit": "44509689b9bf3984d729cc264aacb31cb7f41668" },
"mason-tool-installer.nvim": { "branch": "main", "commit": "b129892f783740e6cf741f2ea09fa5dd512aa584" },
"mason.nvim": { "branch": "main", "commit": "751b1fcbf3d3b783fcf8d48865264a9bcd8f9b10" },
"neo-tree.nvim": { "branch": "v2.x", "commit": "b529fb2ae9206ca1d84ee72b596deecbc088ac59" },
"neo-tree.nvim": { "branch": "main", "commit": "b529fb2ae9206ca1d84ee72b596deecbc088ac59" },
"neodev.nvim": { "branch": "main", "commit": "ce9a2e8eaba5649b553529c5498acb43a6c317cd" },
"nui.nvim": { "branch": "main", "commit": "cbd2668414331c10039278f558630ed19b93e69b" },
"nvim-autopairs": { "branch": "master", "commit": "4f41e5940bc0443fdbe5f995e2a596847215cd2a" },
@ -30,19 +31,19 @@
"nvim-colorizer.lua": { "branch": "master", "commit": "85855b38011114929f4058efc97af1059ab3e41d" },
"nvim-lspconfig": { "branch": "master", "commit": "9266dc26862d8f3556c2ca77602e811472b4c5b8" },
"nvim-surround": { "branch": "main", "commit": "a4e30d33add8a9743b4f518b3a788b3c8e5def71" },
"nvim-tmux-navigation": { "branch": "main", "commit": "4898c98702954439233fdaf764c39636681e2861" },
"nvim-treesitter": { "branch": "master", "commit": "2a95ff14764af20d32ec1edb27e11c38a84b9478" },
"nvim-treesitter-context": { "branch": "master", "commit": "ba05c6b753130d96b284d3e8ba8f54c28c0fb6d1" },
"nvim-treesitter": { "branch": "master", "commit": "3e10cffbb2a022cd8e2aaea9f4fffb514065e77c" },
"nvim-treesitter-context": { "branch": "master", "commit": "c24a7a6dc5fde325af844d165323aa6f7082866e" },
"nvim-treesitter-textobjects": { "branch": "master", "commit": "23b820146956b3b681c19e10d3a8bc0cbd9a1d4c" },
"nvim-ts-autotag": { "branch": "main", "commit": "531f48334c422222aebc888fd36e7d109cb354cd" },
"peek.nvim": { "branch": "master", "commit": "5820d937d5414baea5f586dc2a3d912a74636e5b" },
"plenary.nvim": { "branch": "master", "commit": "8aad4396840be7fc42896e3011751b7609ca4119" },
"schemastore.nvim": { "branch": "main", "commit": "8b9002aae3c284e20020966c8b33242251b079e7" },
"schemastore.nvim": { "branch": "main", "commit": "f660f74bcaae950a77c69dda91270063c8cbd692" },
"smart-splits.nvim": { "branch": "master", "commit": "e11caebbe3ce8fb70aced281931f73519a060e0a" },
"telescope-fzf-native.nvim": { "branch": "main", "commit": "9ef21b2e6bb6ebeaf349a0781745549bbb870d27" },
"telescope-ui-select.nvim": { "branch": "master", "commit": "6e51d7da30bd139a6950adf2a47fda6df9fa06d2" },
"telescope.nvim": { "branch": "master", "commit": "4d4ade7f2b8f403e8816ca50c05ed16e259b21fb" },
"telescope.nvim": { "branch": "master", "commit": "d00d9df48c00d8682c14c2b5da78bda7ef06b939" },
"todo-comments.nvim": { "branch": "main", "commit": "a736bbe08c8eff370dfa60701f1e669816d4e3c8" },
"trouble.nvim": { "branch": "main", "commit": "b9cf677f20bb2faa2dacfa870b084e568dca9572" },
"undotree": { "branch": "master", "commit": "aa93a7e5890dbbebbc064cd22260721a6db1a196" },
"undotree": { "branch": "master", "commit": "56c684a805fe948936cda0d1b19505b84ad7e065" },
"which-key.nvim": { "branch": "main", "commit": "4433e5ec9a507e5097571ed55c02ea9658fb268a" }
}

View File

@ -0,0 +1,5 @@
-- https://github.com/kwkarlwang/bufresize.nvim
return {
"kwkarlwang/bufresize.nvim",
opts = {},
}

View File

@ -1,5 +1,4 @@
-- https://github.com/hrsh7th/nvim-cmp
-- TODO: Go over this
return {
{
-- Autocompletion

View File

@ -69,8 +69,7 @@ return {
return ":IncRename " .. vim.fn.expand("<cword>")
end, { buffer = event.buf, expr = true, desc = "LSP: [R]e[N]ame" })
-- Also works in visual mode
-- TODO: Is that something we even need?
-- TODO: Do we need this to work in visal mode?
vim.keymap.set(
{ "v", "n" },
"<leader>ca",
@ -105,7 +104,6 @@ return {
local capabilities = vim.lsp.protocol.make_client_capabilities()
-- TODO: Only do this is cmp_nvim_lsp is enabled
capabilities = vim.tbl_deep_extend("force", capabilities, require("cmp_nvim_lsp").default_capabilities())
-- TODO: Check if this is still up to date
capabilities.textDocument.colorProvider = {
dynamicRegistration = true,
}

View File

@ -0,0 +1,34 @@
-- https://github.com/mrjones2014/smart-splits.nvim
return {
"mrjones2014/smart-splits.nvim",
dependencies = {
"kwkarlwang/bufresize.nvim",
},
config = function()
vim.keymap.set("n", "<M-h>", require("smart-splits").move_cursor_left)
vim.keymap.set("n", "<M-j>", require("smart-splits").move_cursor_down)
vim.keymap.set("n", "<M-k>", require("smart-splits").move_cursor_up)
vim.keymap.set("n", "<M-l>", require("smart-splits").move_cursor_right)
vim.keymap.set("n", "<C-w>r", require("smart-splits").start_resize_mode, { desc = "Enter resize mode" })
vim.keymap.set("n", "<C-w>h", require("smart-splits").swap_buf_left, { desc = "Swap buffer to the left" })
vim.keymap.set("n", "<C-w>j", require("smart-splits").swap_buf_down, { desc = "Swap buffer to the bottom" })
vim.keymap.set("n", "<C-w>k", require("smart-splits").swap_buf_up, { desc = "Swap buffer to the top" })
vim.keymap.set("n", "<C-w>l", require("smart-splits").swap_buf_right, { desc = "Swap buffer to the right" })
require("smart-splits").setup({
at_edge = "stop",
cursor_follows_swapped_bufs = true,
resize_mode = {
silent = true,
hooks = {
on_enter = function()
vim.notify("Entering resize mode...")
end,
on_leave = require("bufresize").register,
},
},
})
end,
}

View File

@ -1,18 +0,0 @@
-- https://github.com/alexghergh/nvim-tmux-navigation
return {
'alexghergh/nvim-tmux-navigation',
event = "VeryLazy",
config = function()
local nvim_tmux_nav = require('nvim-tmux-navigation')
nvim_tmux_nav.setup {
disable_when_zoomed = true,
keybindings = {
left = '<M-h>',
down = '<M-j>',
up = '<M-k>',
right = '<M-l>',
},
}
end
}

View File

@ -2,8 +2,8 @@
local diagnostic = require("symbols.diagnostic")
return {
-- NOTE: Using a fork for the time being upstream does not support authors
-- 'folke/todo-comments.nvim',
-- NOTE: This fork highlights the entire matched word, not just the keyword.
"doongjohn/todo-comments.nvim",
dependencies = {
"nvim-lua/plenary.nvim",
@ -28,12 +28,19 @@ return {
require("todo-comments").setup({
keywords = {
-- FIX: Fix
FIX = { icon = diagnostic.bug },
-- TODO: Todo
TODO = { icon = diagnostic.todo },
-- HACK: Hack
HACK = { icon = diagnostic.hack },
-- WARN: Warn
WARN = { icon = diagnostic.warning },
-- PERF: Perf
PERF = { icon = diagnostic.performance },
-- NOTE: Note
NOTE = { icon = diagnostic.note },
-- TEST: Test
TEST = { icon = diagnostic.test },
},
highlight = {
@ -46,12 +53,12 @@ return {
pattern = [[\b(KEYWORDS)(\(.*\))?:]],
},
colors = {
error = { "DiagnosticError", "ErrorMsg", "#DC2626" },
warning = { "DiagnosticWarn", "WarningMsg", "#FBBF24" },
info = { "Todo", "#2563EB" },
hint = { "DiagnosticHint", "#10B981" },
default = { "Identifier", "#7C3AED" },
test = { "Identifier", "#FF00FF" },
error = { "TodoCommentError" },
warning = { "TodoCommentWarning" },
info = { "TodoCommentInfo" },
hint = { "TodoCommentHint" },
test = { "TodoCommentTest" },
default = { "TodoCommentDefault" },
},
})
end,

View File

@ -23,6 +23,7 @@ return {
"markdown",
"markdown_inline",
"bash",
"sql",
},
-- Autoinstall languages that are not installed. Defaults to false (but you can change for yourself!)

View File

@ -9,7 +9,7 @@ return {
},
},
init = function()
-- TODO: Can we tie these to where the keymaps are registered?
-- TODO: Only make a category show up if there actually are any keybinds under it
require("which-key").register({
["<leader>g"] = { name = "[G]it", _ = "which_key_ignore" },
["<leader>b"] = { name = "[B]buffer", _ = "which_key_ignore" },

View File

@ -34,6 +34,12 @@ return {
LspReferenceText = { fg = palette.dark0, bg = palette.neutral_purple },
LspReferenceRead = { link = "LspReferenceText" },
LspReferenceWrite = { link = "LspReferenceText" },
TodoCommentError = { fg = palette.bright_red },
TodoCommentWarning = { fg = palette.bright_yellow },
TodoCommentInfo = { fg = palette.light1 },
TodoCommentHint = { fg = palette.bright_aqua },
TodoCommentTest = { fg = palette.bright_purple },
TodoCommentDefault = { fg = palette.bright_blue },
},
})

View File

@ -65,7 +65,7 @@ tools.formatters = require("util.conform").assign_formatters({
json = { "jq" },
toml = { "taplo" },
nix = { "nixfmt" },
-- ["*"] = { "codespell" },
["*"] = { "injected" },
["_"] = { "trim_whitespace", "trim_newlines" },
})

View File

@ -0,0 +1,13 @@
; extends
(macro_invocation
(scoped_identifier
path: (identifier) @path (#eq? @path "sqlx")
name: (identifier) @name (#eq? @name "query")
)
(token_tree
(raw_string_literal
(string_content) @injection.content
(#set! injection.language "sql")
)
)
)

View File

@ -1 +1,2 @@
gruvbox.conf
tpm/

View File

@ -8,16 +8,28 @@ set -s escape-time 0
set-window-option -g xterm-keys on
set-option -g focus-events on
# Setup vi-mode with better keybindings
# TODO: Escape does not work properly for leaving
setw -g mode-keys vi
bind -T copy-mode-vi v send -X begin-selection
bind -T copy-mode-vi y send-keys -X copy-pipe-and-cancel
bind -T copy-mode-vi Escape send-keys -X cancel
# Change leader
unbind C-b
set -g prefix C-a
# Improve navigation between tmux and nvim
is_vim='echo "#{pane_current_command}" | grep -iqE "(^|\/)g?(view|n?vim?)(diff)?$"'
bind -n M-h if-shell "$is_vim" "send-keys M-h" "select-pane -L"
bind -n M-j if-shell "$is_vim" "send-keys M-j" "select-pane -D"
bind -n M-k if-shell "$is_vim" "send-keys M-k" "select-pane -U"
bind -n M-l if-shell "$is_vim" "send-keys M-l" "select-pane -R"
# TODO: Disable pane selection wrap
bind-key -n M-h if -F "#{@pane-is-vim}" 'send-keys M-h' "run '#{select_pane_no_wrap} L'"
bind-key -n M-j if -F "#{@pane-is-vim}" 'send-keys M-j' "run '#{select_pane_no_wrap} D'"
bind-key -n M-k if -F "#{@pane-is-vim}" 'send-keys M-k' "run '#{select_pane_no_wrap} U'"
bind-key -n M-l if -F "#{@pane-is-vim}" 'send-keys M-l' "run '#{select_pane_no_wrap} R'"
bind-key -T copy-mode-vi 'M-h' select-pane -L
bind-key -T copy-mode-vi 'M-j' select-pane -D
bind-key -T copy-mode-vi 'M-k' select-pane -U
bind-key -T copy-mode-vi 'M-l' select-pane -R
# Custom keybinds
bind '"' split-window -c "#{pane_current_path}"
@ -46,3 +58,7 @@ wg_is_keys_off="#([ $(tmux show-option -qv key-table) = 'off' ] && echo 'TRUE' )
# Load theme
source-file "$DOTFILES/tmux/gruvbox.conf"
set -g @plugin "dalejung/tmux-select-pane-no-wrap"
run "$DOTFILES/tmux/tpm/tpm"

1
tmux/tpm Submodule

@ -0,0 +1 @@
Subproject commit 99469c4a9b1ccf77fade25842dc7bafbc8ce9946