feat: boostrap neovim configuration
commit
78cd0d1374
|
@ -0,0 +1,16 @@
|
|||
[*]
|
||||
end_of_line = lf
|
||||
insert_final_newline = true
|
||||
charset = utf-8
|
||||
|
||||
indent_style = tab
|
||||
indent_size = 4
|
||||
trim_trailing_whitespace = false
|
||||
|
||||
[*.yml]
|
||||
indent_style = space
|
||||
indent_size = 2
|
||||
|
||||
[*.yaml]
|
||||
indent_style = space
|
||||
indent_size = 2
|
|
@ -0,0 +1,4 @@
|
|||
####################
|
||||
# - Standard Ignores
|
||||
####################
|
||||
.dev
|
|
@ -0,0 +1,54 @@
|
|||
# NVIM Config
|
||||
|
||||
Need to install the following:
|
||||
```bash
|
||||
# Package Manager
|
||||
sudo apt install chafa
|
||||
sudo apt install libmagickwand-dev
|
||||
sudo apt install librsvg2-bin
|
||||
sudo apt install imagemagick
|
||||
sudo apt install texlive-extra-utils
|
||||
sudo apt install xclip # OR wl-clipboard
|
||||
|
||||
# Rust
|
||||
## - FIRST, install rustup
|
||||
## - https://www.rust-lang.org/
|
||||
rustup component add rust-analyzer
|
||||
cargo install --force bob-nvim
|
||||
cargo install --force rscls
|
||||
cargo install --force ripgrep
|
||||
cargo install --force rust-script
|
||||
cargo install --force tree-sitter-cli
|
||||
cargo install --force fd-find
|
||||
cargo install --force bat
|
||||
cargo install --force git-delta
|
||||
cargo install --force skim
|
||||
|
||||
# Python
|
||||
## - FIRST, install uv
|
||||
## - https://docs.astral.sh/uv/
|
||||
uv tool install --upgrade mypy
|
||||
uv tool install --upgrade ruff
|
||||
uv tool install --upgrade basepyright
|
||||
uv tool install --upgrade cairosvg
|
||||
|
||||
# Haskell
|
||||
## - FIRST, install "stack".
|
||||
## - https://docs.haskellstack.org/en/stable/
|
||||
stack update
|
||||
stack install ShellCheck
|
||||
|
||||
# GO
|
||||
## - FIRST, install "g".
|
||||
## - https://github.com/stefanmaric/g
|
||||
## - REMEMBER to 'export GOPATH=$HOME/.go-path' before installing
|
||||
go install mvdan.cc/sh/v3/cmd/shfmt@latest
|
||||
go install lazygit
|
||||
|
||||
# remote-python
|
||||
## Used by plugins that run external to neovim, written in Python
|
||||
cd $HOME/comps/neovim
|
||||
uv init --no-readme --python 3.12 remote-python
|
||||
cd remote-python
|
||||
uv add pynvim jupyter_client requests websocket-client plotly kaleido==0.2.1
|
||||
```
|
|
@ -0,0 +1,124 @@
|
|||
Neovim Version Manager: https://github.com/MordechaiHadad/bob
|
||||
|
||||
|
||||
Search: telescope.nvim?
|
||||
|
||||
Version Control:
|
||||
- [ ] sindrets/diffview.nvim: Reviewing changes seems like an ideal thing.
|
||||
- [ ] gitsigns: Some more configuration.
|
||||
- For more crazy git stuff, just toggleterm into lazygit.
|
||||
|
||||
LSP
|
||||
- What do we think of `<leader>l` for LSP stuff? We already have `<leader>t` for test stuff and `<leader>d` for debug stuff, right?
|
||||
- [ ] Formatters don't always behave. Consider stevearc/conform.nvim.
|
||||
- [ ] Finish config incl. reconsider keymaps. See https://neovim.io/doc/user/lsp.html#_quickstart.
|
||||
- [ ] Finish getting and configuring a bunch of LSPs. See https://github.com/neovim/nvim-lspconfig/blob/master/lua/lspconfig/configs/ruff.lua
|
||||
- [ ] folke/trouble.nvim: Configure it as a kind of universal "what's up" sidebar.
|
||||
- Consider keyboard shortcuts to manage a "permanant" right-hand-side buffer, which should support mindful trouble info and diagnostics, ongoing neotest harnesses, and running DAP processes.
|
||||
|
||||
Editing:
|
||||
- Tutorial: https://martinlwx.github.io/en/learn-to-use-text-objects-in-vim/
|
||||
- [ ] folke/todo-comments.nvim: Honestly such a crazy neat thing.
|
||||
- [ ] lukas-reineke/headlines.nvim
|
||||
- [ ] kylechui/nvim-surround: For managing stuff wrapped in other stuff.
|
||||
- [ ] nvim-treesitter/nvim-treesitter-textobjects: Syntax aware text objects.
|
||||
- [ ] roobert/surround-ui.nvim: For pretty and learning.
|
||||
- [ ] numToStr/Comment.nvim: Honestly, we do a lot of commenting overall.
|
||||
- [ ] danymat/neogen: No excuse not to write documentation now :)
|
||||
- [ ] hat0uma/csvview.nvim: Handle CSV files directly and sanely.
|
||||
|
||||
Motion:
|
||||
- [ ] folke/flash.nvim: Fast motions.
|
||||
- [ ] chrishrb/gx.nvim: Better implementation of `gx`.
|
||||
|
||||
UX:
|
||||
- For the editing overview, use the toggleable filetree.
|
||||
- [ ] matbme/JABS.nvim: OH HELLO! A tiny little buffer switcher boi!
|
||||
- [ ] kazhala/close-buffers.nvim: Maybe not exactly this, but some sort of principled way of keeping buffers under control and not outside of my object permanance.
|
||||
- Like this: ChuufMaster/buffer-vacuum
|
||||
- [ ] nanozuki/tabby.nvim: Don't use the tabs as a bufferline.
|
||||
- Use it as a buffer multiplexer.
|
||||
- [ ] akinsho/toggleterm.nvim: Don't mess around with tmux.
|
||||
- [ ] Consider breadcrumbs? See: Bekaboo/dropbar.nvim
|
||||
- [ ] 3rd/image.nvim: Support images. Mainly for other plugins.
|
||||
|
||||
Workflow:
|
||||
- Need solution for the following:
|
||||
- `nvim file.txt` without any hubub, incl. use of LSPs and such. Doesn't need to be recoverable.
|
||||
- Opening any file within a project should cd to that project's root.
|
||||
- Special project should be daily-note taking, w/sync across platforms.
|
||||
- Turning notes into other stuff ex. calendar events, tasks, projects, notes within projects.
|
||||
- Projects in predictable places should be quick to navigate to.
|
||||
- Having many projects open w/different layouts, all sessions under the project's namespace.
|
||||
- Automatic session saving and recovery, including buffer layouts and terminals.
|
||||
- [ ] gnikdroy/projections.nvim: It has its frustrations, but it
|
||||
- [ ] Consider coffebar/neovim-project as alternative.
|
||||
- Consider the multi-branch sessions workflows. Ideally, reuse the LSP rootdir. Ensure correct CWD is set.
|
||||
- We might just have to DIY this...
|
||||
- [ ] nvim-tree/nvim-tree: Finish configuring properly. The floating window is nice. Relies only on correct CWD.
|
||||
- Or oil.nvim?
|
||||
- [ ] moyiz/git-dev.nvim: Easy shallow clones.
|
||||
|
||||
Completion:
|
||||
- [ ] nvim-cmp
|
||||
|
||||
AI:
|
||||
- [ ] David-Kunz/gen.nvim
|
||||
- Combine with a mindful way of starting ollama.
|
||||
|
||||
Quarto:
|
||||
- [ ] jmbuhr/otter.nvim: Embedding langs within other langs.
|
||||
- See the `injected` formatter for stevearc/conform.nvim. Ex: https://github.com/jmbuhr/quarto-nvim-kickstarter/blob/382b050e13eada7180ad048842386be37e820660/lua/plugins/editing.lua#L29-L81
|
||||
- [ ] benlubas/molten-nvim: Running code cells.
|
||||
- [ ] HakonHarnes/img-clip.nvim: Paste images directly from clipboard.
|
||||
- [ ] jbyuki/nabla.nvim: Preview LaTeX.
|
||||
- jakewvincent/mkdnflow.nvim: Consider this little plugin.
|
||||
- [ ] lukas-reineke/headlines.nvim: This one too!
|
||||
- Or this? MeanderingProgrammer/render-markdown.nvim
|
||||
- [ ] Myzel394/easytables.nvim: Make markdown tables awesome.
|
||||
- [ ] nvim-telescope/telescope-bibtex.nvim
|
||||
|
||||
Workflows:
|
||||
- There exists this: b0o/blender.nvim. Can we do better with `blext`?
|
||||
- mrcjkb/rustaceanvim: Superpowered Rust.
|
||||
- roobert/tailwindcss-colorizer-cmp.nvim and luckasRanarison/tailwind-tools.nvim: For TailwindCSS
|
||||
|
||||
|
||||
|
||||
Organization:
|
||||
- Zeioth/markmap.nvim: Mindmap from markdown.
|
||||
- richardbizik/nvim-toc: A little niche, but isn't it interesting?
|
||||
- [ ] nfrid/due.nvim: Extremely clever use of virtual text.
|
||||
- Some sort of "scratchpad" that doesn't just get deleted by default.
|
||||
|
||||
Annoyances:
|
||||
- roobert/f-string-toggle.nvim: Fucking finally!
|
||||
- [ ] nfrid/markdown-togglecheck: Toggle Markdown checkboxes! Kinda hype, to be honest.
|
||||
- nkakouros-original/numbers.nvim: Slightly smarter relative line numbers.
|
||||
- Saecki/crates.nvim: This is nice. Makes crate management maybe a bit easier.
|
||||
- linrongbin16/gitlinker.nvim: Generate permalinks to lines in git.
|
||||
- Something to help navigate between many open windows. yorickpeterse/nvim-window?
|
||||
- Wansmer/treesj: Yay!
|
||||
|
||||
Big Projects:
|
||||
- ray-x/sad.nvim: Large scale refactoring with `sad`.
|
||||
|
||||
Niche:
|
||||
- Julian/lean.nvim: Lean theorem prover w/interactivity.
|
||||
- niuiic/typst-preview.nvim: typst does look quite interesting.
|
||||
- theKnightsOfRohan/hexer.nvim: Converting between binary representations.
|
||||
- Willem-J-an/visidata.nvim: Exploring pandas (polars too?) data in a terminal.
|
||||
- sachinsenal0x64/hot.nvim: Seems interesting but unsure how exactly.
|
||||
- notomo/gesture.nvim: Unironically interesting for touchscreens.
|
||||
- azratul/live-share.nvim: Pair programming.
|
||||
- m4xshen/hardtime.nvim: Bad habits die hard.
|
||||
- krady21/compiler-explorer.nvim: I love it, but I want it local...
|
||||
|
||||
Testing: nvim-neotest
|
||||
- [ ] Python
|
||||
- [ ] Rust
|
||||
- [ ] C++
|
||||
|
||||
Debugging: nvim-dap
|
||||
- [ ] Python: debugpy
|
||||
- [ ] C++: codelldb
|
|
@ -0,0 +1 @@
|
|||
;extends
|
|
@ -0,0 +1,5 @@
|
|||
;extends
|
||||
|
||||
(fenced_code_block (code_fence_content) @cell.inner) @cell.outer
|
||||
|
||||
(paragraph) @function.outer @function.inner
|
|
@ -0,0 +1,5 @@
|
|||
;extends
|
||||
|
||||
[
|
||||
(shortcut_link)
|
||||
] @nospell
|
|
@ -0,0 +1,11 @@
|
|||
;extends
|
||||
(
|
||||
(comment) @comment
|
||||
(#match? @comment "^\\#\\|")
|
||||
) @text.literal
|
||||
|
||||
|
||||
(
|
||||
(comment) @content
|
||||
(#match? @content "^\\# ?\\%\\%")
|
||||
) @cell.outer @text.literal
|
|
@ -0,0 +1,6 @@
|
|||
;extends
|
||||
|
||||
(
|
||||
(comment) @content1
|
||||
(#match? @content1 "^\\# ?\\%\\%")
|
||||
) @cell.inner
|
|
@ -0,0 +1,36 @@
|
|||
-- [[ Config Loading ]]
|
||||
--vim.loader.enable() -- Cached Module Loader
|
||||
|
||||
-- [[ Leader Config ]]
|
||||
--- See `:help mapleader`
|
||||
--- NOTE: Must happen before plugins are loaded (otherwise wrong leader will be used)
|
||||
vim.g.mapleader = ' '
|
||||
vim.g.maplocalleader = ' '
|
||||
|
||||
-- [[ NERD Font Declaration ]]
|
||||
vim.g.have_nerd_font = true
|
||||
|
||||
-- [[ Remote Python ]]
|
||||
local remote_python_path = vim.env.HOME .. '/comps/neovim/remote-python'
|
||||
vim.g.python3_host_prog = remote_python_path .. '/.venv/bin/python'
|
||||
|
||||
-- [[ Vim Options ]]
|
||||
require('options')
|
||||
|
||||
-- [[ Global Keymaps ]]
|
||||
require('keymaps')
|
||||
|
||||
-- [[ Global Autocmds ]]
|
||||
require('autocmds')
|
||||
|
||||
-- [[ User Commands ]]
|
||||
require('usercmds')
|
||||
|
||||
-- [[ GUI Config ]]
|
||||
require('guis')
|
||||
|
||||
-- [[ Plugins ]]
|
||||
require('plugins')
|
||||
|
||||
-- [[ LSP Configuration ]]
|
||||
require('lsp')
|
|
@ -0,0 +1,33 @@
|
|||
{
|
||||
"blink.cmp": { "branch": "main", "commit": "b6f11a0aa33e601c469a126e3ed6e35208fe3ea3" },
|
||||
"catppuccin": { "branch": "main", "commit": "5e36ca599f4aa41bdd87fbf2c5aae4397ac55074" },
|
||||
"cellular-automaton.nvim": { "branch": "main", "commit": "11aea08aa084f9d523b0142c2cd9441b8ede09ed" },
|
||||
"conform.nvim": { "branch": "master", "commit": "363243c03102a531a8203311d4f2ae704c620d9b" },
|
||||
"flatten.nvim": { "branch": "main", "commit": "b17a3e65c2e4e2ecd1345a2d08435e80f982c4a6" },
|
||||
"friendly-snippets": { "branch": "main", "commit": "efff286dd74c22f731cdec26a70b46e5b203c619" },
|
||||
"fzf-lua": { "branch": "main", "commit": "e3fefd97875827e47dc4bbf1074ee464b2d8e6a8" },
|
||||
"fzf-lua-projections.nvim": { "branch": "main", "commit": "411672ab6f7c38d3a4a51916fda1a01c1618ae04" },
|
||||
"gitsigns.nvim": { "branch": "main", "commit": "9b36d497495436c135659902054ee637e0ba6021" },
|
||||
"image.nvim": { "branch": "master", "commit": "7704e1d03d952393774dc7d00a98d8e127086ba4" },
|
||||
"img-clip.nvim": { "branch": "main", "commit": "5ded6f468d633ccfb315905fe8901d6c95ae8f29" },
|
||||
"lazy.nvim": { "branch": "main", "commit": "f15a93907ddad3d9139aea465ae18336d87f5ce6" },
|
||||
"lsp_lines.nvim": { "branch": "main", "commit": "a92c755f182b89ea91bd8a6a2227208026f27b4d" },
|
||||
"mdmath.nvim": { "branch": "main", "commit": "699acb27fd34bfdf92a43ce0abdd17f0c7a948fe" },
|
||||
"mini.files": { "branch": "main", "commit": "0db8f49088bcefff23c5cb8498a6c94e46a45a8e" },
|
||||
"molten-nvim": { "branch": "main", "commit": "a286aa914d9a154bc359131aab788b5a077a5a99" },
|
||||
"nabla.nvim": { "branch": "master", "commit": "27a6ea9ed7452bb9e0b19eb0942b5bcf7d051b2f" },
|
||||
"neotest": { "branch": "master", "commit": "d66cf4e05a116957f0d3a7755a24291c7d1e1f72" },
|
||||
"neotest-python": { "branch": "master", "commit": "a2861ab3c9a0bf75a56b11835c2bfc8270f5be7e" },
|
||||
"nvim-nio": { "branch": "master", "commit": "21f5324bfac14e22ba26553caf69ec76ae8a7662" },
|
||||
"nvim-treesitter": { "branch": "master", "commit": "cfc6f2c117aaaa82f19bcce44deec2c194d900ab" },
|
||||
"nvim-treesitter-textobjects": { "branch": "master", "commit": "ad8f0a472148c3e0ae9851e26a722ee4e29b1595" },
|
||||
"nvim-web-devicons": { "branch": "master", "commit": "5740b7382429d20b6ed0bbdb0694185af9507d44" },
|
||||
"otter.nvim": { "branch": "main", "commit": "0e42fa795c35c7190935e3beda3791189c41bb72" },
|
||||
"plenary.nvim": { "branch": "master", "commit": "2d9b06177a975543726ce5c73fca176cedbffe9d" },
|
||||
"projections.nvim": { "branch": "main", "commit": "889914169fa1f5c00fb8659653b5a8330fb223e6" },
|
||||
"render-markdown.nvim": { "branch": "main", "commit": "17a77463f945c4b9e4f371c752efd90e3e1bf604" },
|
||||
"snacks.nvim": { "branch": "main", "commit": "b773368f8aa6e84a68e979f0e335d23de71f405a" },
|
||||
"tiny-code-action.nvim": { "branch": "main", "commit": "34d8a0053a833dbc51b2eecc1170bd35aa18baa4" },
|
||||
"vim-sleuth": { "branch": "master", "commit": "be69bff86754b1aa5adcbb527d7fcd1635a84080" },
|
||||
"which-key.nvim": { "branch": "main", "commit": "0e76a87ac51772569aec678dc74baa8e2a86100c" }
|
||||
}
|
|
@ -0,0 +1,15 @@
|
|||
return {
|
||||
cmd = { 'basedpyright-langserver', '--stdio' },
|
||||
filetypes = { 'python' },
|
||||
root_markers = { "pyproject.toml" },
|
||||
settings = {
|
||||
basedpyright = {
|
||||
disableOrganizeImports = true,
|
||||
analysis = {
|
||||
autoSearchPaths = true,
|
||||
useLibraryCodeForTypes = true,
|
||||
diagnosticMode = 'openFilesOnly',
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
|
@ -0,0 +1,19 @@
|
|||
return {
|
||||
cmd = { 'lua-language-server' },
|
||||
filetypes = { 'lua' },
|
||||
root_markers = { '.luarc.json', '.luarc.jsonc' },
|
||||
settings = {
|
||||
Lua = {
|
||||
runtime = {
|
||||
version = 'LuaJIT',
|
||||
},
|
||||
workspace = {
|
||||
checkThirdParty = false,
|
||||
library = {
|
||||
vim.env.VIMRUNTIME,
|
||||
},
|
||||
},
|
||||
telemetry = {enable = false},
|
||||
},
|
||||
},
|
||||
}
|
|
@ -0,0 +1,5 @@
|
|||
return {
|
||||
cmd = { 'ruff', 'server' },
|
||||
filetypes = { 'python' },
|
||||
root_markers = { "pyproject.toml" },
|
||||
}
|
|
@ -0,0 +1,5 @@
|
|||
return {
|
||||
cmd = { 'rust-analyzer' },
|
||||
filetypes = { 'rust' },
|
||||
root_markers = { "Cargo.toml" },
|
||||
}
|
|
@ -0,0 +1,5 @@
|
|||
-- [[ Autocommands ]]
|
||||
-- See `:help lua-guide-autocommands`
|
||||
|
||||
require 'autocmds/lsp'
|
||||
require 'autocmds/yank_hl'
|
|
@ -0,0 +1,145 @@
|
|||
-- See: https://neovim.io/doc/user/lsp.html#lsp-defaults
|
||||
vim.keymap.del('n', 'grn')
|
||||
vim.keymap.del({ 'n', 'v' }, 'gra')
|
||||
vim.keymap.del('n', 'grr')
|
||||
vim.keymap.del('n', 'gri')
|
||||
vim.keymap.del('n', 'gO')
|
||||
vim.keymap.del('i', '<c-s>')
|
||||
|
||||
vim.api.nvim_create_autocmd('LspAttach', {
|
||||
callback = function(args)
|
||||
-- See: https://neovim.io/doc/user/lsp.html#lsp-defaults
|
||||
vim.lsp.config('*', require('blink.cmp').get_lsp_capabilities({}, false))
|
||||
|
||||
-- Retrieve Dependencies
|
||||
local lsp_client = vim.lsp.get_client_by_id(args.data.client_id)
|
||||
local buf = args.buf
|
||||
|
||||
-- LSP: Code Completion
|
||||
if lsp_client:supports_method('textDocument/completion') then
|
||||
vim.lsp.completion.enable(
|
||||
true,
|
||||
lsp_client.id,
|
||||
buf,
|
||||
{ autotrigger = false }
|
||||
)
|
||||
end
|
||||
|
||||
-- LSP: Diagnostics
|
||||
if lsp_client:supports_method('textDocument/diagnostic') then
|
||||
vim.keymap.set(
|
||||
'n',
|
||||
'<leader>le',
|
||||
require('fzf-lua').diagnostics_document,
|
||||
{ buffer = buf, desc = '[L]SP [E]rrors' })
|
||||
end
|
||||
|
||||
-- LSP: Diagnostics
|
||||
if lsp_client:supports_method('textDocument/signatureHelp') then
|
||||
vim.keymap.set(
|
||||
'i',
|
||||
'<c-s>',
|
||||
vim.lsp.buf.signature_help,
|
||||
{ buffer = buf, desc = 'LSP Signature Help' })
|
||||
end
|
||||
|
||||
-- LSP Action: Formatting
|
||||
if lsp_client:supports_method('textDocument/formatting') or lsp_client.name == 'otter-ls[1]' then
|
||||
vim.keymap.set(
|
||||
'n',
|
||||
'<leader>lf',
|
||||
function()
|
||||
require('conform').format({
|
||||
async = true,
|
||||
bufnr = buf,
|
||||
id = lsp_client.id,
|
||||
})
|
||||
end,
|
||||
{ buffer = buf, desc = '[L]SP [F]ormat' }
|
||||
)
|
||||
|
||||
-- Format the current buffer on save
|
||||
--- TODO: Only on filetypes w/fast formatters?
|
||||
--vim.api.nvim_create_autocmd('BufWritePre', {
|
||||
-- buffer = buf,
|
||||
-- callback = function()
|
||||
-- require('conform').format({
|
||||
-- async = true,
|
||||
-- bufnr = buf,
|
||||
-- id = lsp_client.id,
|
||||
-- })
|
||||
-- --vim.lsp.buf.format({ bufnr = buf, id = lsp_client.id })
|
||||
-- end
|
||||
--})
|
||||
end
|
||||
|
||||
-- LSP Action: Inlay Hint
|
||||
--- WORKAROUND: otter-ls seems to crash with inlayHint.
|
||||
if lsp_client:supports_method('textDocument/inlayHint') and not lsp_client.name == 'otter-ls[1]' then
|
||||
vim.lsp.inlay_hint.enable(true, { bufnr = buf })
|
||||
|
||||
vim.keymap.set(
|
||||
'n',
|
||||
'<leader>lh',
|
||||
function()
|
||||
if vim.lsp.inlay_hint.is_enabled({ bufnr = buf }) then
|
||||
vim.lsp.inlay_hint.enable(false, { bufnr = buf })
|
||||
else
|
||||
vim.lsp.inlay_hint.enable(true, { bufnr = buf })
|
||||
end
|
||||
end,
|
||||
{ desc = '[L]SP Toggle Inlay [H]ints' }
|
||||
)
|
||||
end
|
||||
|
||||
-- LSP Action: Code Actions
|
||||
if lsp_client:supports_method('textDocument/codeAction') then
|
||||
vim.keymap.set(
|
||||
'n',
|
||||
'<leader>li',
|
||||
require('fzf-lua').lsp_code_actions,
|
||||
{ buffer = buf, desc = '[L]SP F[I]xes' }
|
||||
)
|
||||
end
|
||||
|
||||
-- LSP Action: Rename
|
||||
if lsp_client:supports_method('textDocument/rename') then
|
||||
vim.keymap.set(
|
||||
'n',
|
||||
'<leader>lr',
|
||||
vim.lsp.buf.rename,
|
||||
{ buffer = buf, desc = '[L]SP [R]ename' }
|
||||
)
|
||||
end
|
||||
|
||||
-- LSP Action: "Hover"
|
||||
if lsp_client:supports_method('textDocument/hover') then
|
||||
vim.keymap.set(
|
||||
'n',
|
||||
'K',
|
||||
vim.lsp.buf.hover,
|
||||
{ buffer = buf, desc = '[L]SP Hover' }
|
||||
)
|
||||
end
|
||||
|
||||
-- LSP Action: References
|
||||
if (
|
||||
lsp_client:supports_method('textDocument/references')
|
||||
or lsp_client:supports_method('textDocument/typeDefinition')
|
||||
or lsp_client:supports_method('textDocument/definition')
|
||||
) then
|
||||
vim.keymap.set(
|
||||
'n',
|
||||
'<leader>ld',
|
||||
require('fzf-lua').lsp_finder,
|
||||
{ buffer = buf, desc = '[L]SP Fin[D]er' }
|
||||
)
|
||||
end
|
||||
|
||||
-- LSP Action: List Buffer Symbols
|
||||
if lsp_client:supports_method('textDocument/documentSymbol') then
|
||||
vim.keymap.set('n', '<leader>ls', require('fzf-lua').lsp_document_symbols,
|
||||
{ buffer = buf, desc = '[L]SP [S]ymbols' })
|
||||
end
|
||||
end
|
||||
})
|
|
@ -0,0 +1,9 @@
|
|||
-- Highlight when yanking (copying) text
|
||||
vim.api.nvim_create_autocmd('TextYankPost', {
|
||||
desc = 'Highlight when yanking (copying) text',
|
||||
group = vim.api.nvim_create_augroup('user-highlight-yank', { clear = true }),
|
||||
callback = function()
|
||||
vim.highlight.on_yank()
|
||||
end,
|
||||
})
|
||||
--- See `:help vim.highlight.on_yank()`
|
|
@ -0,0 +1,6 @@
|
|||
-- [[ GUI Config ]]
|
||||
|
||||
-- Neovide
|
||||
if vim.g.neovide then
|
||||
require 'guis/neovide'
|
||||
end
|
|
@ -0,0 +1,15 @@
|
|||
-- See https://neovide.dev/configuration.html
|
||||
vim.o.guifont = 'Hack Nerd Font Mono FC Ligatured:h14'
|
||||
vim.g.neovide_theme = 'auto'
|
||||
vim.g.neovide_transparency = 0.93
|
||||
vim.g.neovide_scroll_animation_length = 0.1
|
||||
vim.g.neovide_scroll_animation_far_lines = 1
|
||||
vim.g.neovide_hide_mouse_when_typing = true
|
||||
|
||||
vim.g.neovide_cursor_animation_length = 0.08
|
||||
vim.g.neovide_cursor_vfx_mode = 'wireframe'
|
||||
vim.g.neovide_cursor_trail_size = 0.15
|
||||
|
||||
--vim.g.neovide_unlink_border_highlights = true
|
||||
--vim.g.neovide_refresh_rate = 40
|
||||
--vim.g.neovide_refresh_rate_idle = 5 --Doesn't seem to have wayland support
|
|
@ -0,0 +1,5 @@
|
|||
-- [[ Basic Keymaps ]]
|
||||
--- See `:help vim.keymap.set()`
|
||||
require 'keymaps/search_hl'
|
||||
require 'keymaps/split_nav'
|
||||
require 'keymaps/float_diag'
|
|
@ -0,0 +1,61 @@
|
|||
vim.keymap.set(
|
||||
'n',
|
||||
'<leader>ds',
|
||||
function()
|
||||
vim.diagnostic.open_float()
|
||||
end,
|
||||
{ desc = '[D]ebug Float', silent = true }
|
||||
)
|
||||
|
||||
|
||||
vim.keymap.set(
|
||||
'n',
|
||||
'[d',
|
||||
function()
|
||||
vim.diagnostic.jump({
|
||||
count = -1,
|
||||
float = not vim.diagnostic.config().virtual_lines,
|
||||
wrap = false,
|
||||
})
|
||||
end,
|
||||
{ desc = 'Prev [D]iagnoatic', silent = true }
|
||||
)
|
||||
vim.keymap.set(
|
||||
'n',
|
||||
']d',
|
||||
function()
|
||||
vim.diagnostic.jump({
|
||||
count = 1,
|
||||
float = not vim.diagnostic.config().virtual_lines,
|
||||
wrap = false,
|
||||
})
|
||||
end,
|
||||
{ desc = 'Next [D]iagnostic', silent = true }
|
||||
)
|
||||
|
||||
vim.keymap.set(
|
||||
'n',
|
||||
'[e',
|
||||
function()
|
||||
vim.diagnostic.jump({
|
||||
count = -1,
|
||||
float = not vim.diagnostic.config().virtual_lines,
|
||||
wrap = false,
|
||||
severity = vim.diagnostic.severity.ERROR,
|
||||
})
|
||||
end,
|
||||
{ desc = 'Prev [E]rror', silent = true }
|
||||
)
|
||||
vim.keymap.set(
|
||||
'n',
|
||||
']e',
|
||||
function()
|
||||
vim.diagnostic.jump({
|
||||
count = 1,
|
||||
float = not vim.diagnostic.config().virtual_lines,
|
||||
wrap = false,
|
||||
severity = vim.diagnostic.severity.ERROR,
|
||||
})
|
||||
end,
|
||||
{ desc = 'Next [E]rror', silent = true }
|
||||
)
|
|
@ -0,0 +1,3 @@
|
|||
-- Set Highlight on Search
|
||||
vim.opt.hlsearch = true
|
||||
vim.keymap.set('n', '<leader><space>', '<cmd>nohlsearch<CR>')
|
|
@ -0,0 +1,6 @@
|
|||
-- Split Window Keymaps
|
||||
vim.keymap.set('n', '<C-h>', '<C-w><C-h>', { desc = 'Move focus to the left window' })
|
||||
vim.keymap.set('n', '<C-l>', '<C-w><C-l>', { desc = 'Move focus to the right window' })
|
||||
vim.keymap.set('n', '<C-j>', '<C-w><C-j>', { desc = 'Move focus to the lower window' })
|
||||
vim.keymap.set('n', '<C-k>', '<C-w><C-k>', { desc = 'Move focus to the upper window' })
|
||||
--- See `:help wincmd` for a list of all window commands
|
|
@ -0,0 +1,6 @@
|
|||
vim.lsp.enable({
|
||||
'ruff',
|
||||
'basedpyright',
|
||||
'rust_analyzer',
|
||||
'lua-language-server',
|
||||
})
|
|
@ -0,0 +1,67 @@
|
|||
-- [[ Setting options ]]
|
||||
--- See `:help vim.opt`
|
||||
--- For more options, see `:help option-list`
|
||||
|
||||
-- Show Line Numbers
|
||||
vim.opt.number = true
|
||||
vim.opt.relativenumber = true
|
||||
--- Use relative line numbers (normal would be vim.opt.number = true)
|
||||
|
||||
-- Default Tabbing
|
||||
vim.opt.tabstop = 4
|
||||
vim.opt.shiftwidth = 4
|
||||
|
||||
-- Line Breaking
|
||||
vim.opt.linebreak = true
|
||||
|
||||
-- Enable Mouse Mode
|
||||
vim.opt.mouse = 'a'
|
||||
--- Can be useful for resizing splits for example!
|
||||
|
||||
-- Don't Show Mode
|
||||
vim.opt.showmode = false
|
||||
--- It's already in the status line
|
||||
|
||||
-- Sync Clipboard btwn OS and Neovim
|
||||
vim.opt.clipboard = 'unnamedplus'
|
||||
--- See `:help 'clipboard'`
|
||||
|
||||
-- "Indent" Decision Trigger on Break
|
||||
vim.opt.breakindent = true
|
||||
|
||||
-- Save Undo History
|
||||
vim.opt.undofile = true
|
||||
|
||||
-- Search Case
|
||||
vim.opt.ignorecase = true
|
||||
vim.opt.smartcase = true
|
||||
--- Ignore case...
|
||||
--- ...UNLESS \C or capital letter in search
|
||||
|
||||
-- Keep Signcolumn On
|
||||
vim.opt.signcolumn = 'yes'
|
||||
|
||||
-- Decrease Update Time
|
||||
vim.opt.updatetime = 250
|
||||
vim.opt.timeoutlen = 300
|
||||
|
||||
-- Configure New Split Behavior
|
||||
vim.opt.splitright = true
|
||||
vim.opt.splitbelow = true
|
||||
--- Splits will appear below to the right, which feels natural
|
||||
|
||||
-- Configure Whitespace Character Representations
|
||||
vim.opt.list = true
|
||||
vim.opt.listchars = { tab = '» ', trail = '·', nbsp = '␣' }
|
||||
--- See `:help 'list'`...
|
||||
--- ...and `:help 'listchars'`
|
||||
|
||||
-- Preview Potential Substitutions Live
|
||||
vim.opt.inccommand = 'split'
|
||||
--- Shows what would be auto-completed
|
||||
|
||||
-- Highlight Current Line (containing Cursor)
|
||||
vim.opt.cursorline = true
|
||||
|
||||
-- Minimal # Screen Lines Above/Below Cursor
|
||||
vim.opt.scrolloff = 10
|
|
@ -0,0 +1,159 @@
|
|||
-- Install Lazy
|
||||
--- Update Lazy.nvim by manually deleting 'lazy_path' and restarting nvim
|
||||
local lazy_repo = "https://github.com/folke/lazy.nvim.git"
|
||||
local lazy_tag = "v11.16.2"
|
||||
|
||||
local lazy_path = vim.fn.stdpath("data") .. "/lazy/lazy.nvim"
|
||||
if not vim.loop.fs_stat(lazy_path) then
|
||||
vim.fn.system({
|
||||
"git",
|
||||
"clone",
|
||||
"--filter=blob:none",
|
||||
lazy_repo,
|
||||
"https://github.com/folke/lazy.nvim.git",
|
||||
"--branch=" .. lazy_tag,
|
||||
lazy_path,
|
||||
})
|
||||
end
|
||||
vim.opt.rtp:prepend(lazy_path)
|
||||
|
||||
-- Install / Setup Plugins
|
||||
--- See :Lazy for more
|
||||
require('lazy').setup({
|
||||
--####################
|
||||
--# - General Plugins
|
||||
--####################
|
||||
require('plugins/snacks'),
|
||||
|
||||
-- Libraries
|
||||
require('plugins/libs/plenary'),
|
||||
require('plugins/libs/nvim-web-devicons'),
|
||||
require('plugins/libs/nvim-nio'),
|
||||
--require('plugins/libs/nui'),
|
||||
--require('plugins/libs/nvim-notify'),
|
||||
require('plugins/libs/image-nvim'),
|
||||
-- TODO: Some kind of image display library.
|
||||
|
||||
-- Search: telescope (for now)
|
||||
--- Keys: <leader>s
|
||||
require('plugins/search/fzf-lua'),
|
||||
|
||||
-- Version Control: git
|
||||
---- Keys: <leader>g
|
||||
require('plugins/vcs/gitsigns'),
|
||||
--require('plugins/vcs/gitlinker')
|
||||
|
||||
-- LSP: native
|
||||
--- Keys: <leader>l
|
||||
require('plugins/lsp/lsp-lines'),
|
||||
require('plugins/lsp/tiny-code-action'),
|
||||
|
||||
-- Editing: treesitter
|
||||
require('plugins/editing/treesitter'),
|
||||
--require('plugins/editing/todo-comments'),
|
||||
--require('plugins/editing/nvim-surround')
|
||||
--require('plugins/editing/surround-ui')
|
||||
--require('plugins/editing/Comment')
|
||||
--require('plugins/editing/neogen')
|
||||
--require('plugins/editing/gen')
|
||||
--require('plugins/editing/treesj')
|
||||
require('plugins/editing/conform-nvim'),
|
||||
|
||||
-- Motion
|
||||
--require('plugins/motion/flash')
|
||||
--require('plugins/motion/gx')
|
||||
|
||||
-- UX
|
||||
--- <leader>u for UI/UX Effects
|
||||
--require('plugins/ux/noice'),
|
||||
require('plugins/ux/vim-sleuth'),
|
||||
require('plugins/ux/which-key'),
|
||||
-- TODO: A buffer management solution of some kind.
|
||||
--require('plugins/ux/tabby'),
|
||||
--require('plugins/ux/toggleterm'),
|
||||
--require('plugins/ux/dropbar'),
|
||||
require('plugins/ux/flatten'),
|
||||
|
||||
-- Workflow
|
||||
--require('plugins/workflow/neovim-project'),
|
||||
require('plugins/workflow/projections'),
|
||||
require('plugins/workflow/mini-files'),
|
||||
--require('plugins/workflow/git-dev'),
|
||||
--require('plugins/workflow/sad'),
|
||||
|
||||
-- Organization
|
||||
--require('plugins/org/due')
|
||||
|
||||
--####################
|
||||
--# - Language Plugins
|
||||
--####################
|
||||
-- Lang: Markdown / Quarto
|
||||
require('plugins/langs/md_quarto/molten-nvim'),
|
||||
require('plugins/langs/md_quarto/otter'),
|
||||
require('plugins/langs/md_quarto/quarto-nvim'),
|
||||
require('plugins/langs/md_quarto/img-clip'),
|
||||
require('plugins/langs/md_quarto/mdmath'),
|
||||
require('plugins/langs/md_quarto/nabla'),
|
||||
--require('plugins/langs/md_quarto/mkdnflow')
|
||||
--require('plugins/langs/md_quarto/easytables'),
|
||||
require('plugins/langs/md_quarto/render-markdown-nvim'),
|
||||
|
||||
-- Lang: Python
|
||||
--require('plugins/langs/python/f-string-toggle'),
|
||||
|
||||
-- Lang: Rust
|
||||
--require('plugins/langs/rust/rustaceanvim'),
|
||||
|
||||
-- Lang: CSV
|
||||
--require('plugins/langs/csv/csvview'),
|
||||
|
||||
--####################
|
||||
--# - Adaptor-Based Plugins
|
||||
--####################
|
||||
-- Completion: blink-cmp
|
||||
require('plugins/completion/friendly-snippets'),
|
||||
--require('plugins/completion/minuet-ai'),
|
||||
require('plugins/completion/blink'),
|
||||
|
||||
-- Debugging: nvim-dap
|
||||
--- Keys: <leader>d
|
||||
--require('plugins/debugging/nvim-dap-ui'),
|
||||
--require('plugins/debugging/nvim-dap-virtual-text'),
|
||||
--require('plugins/debugging'),
|
||||
|
||||
-- Testing: nvim-neotest
|
||||
--- Keys: <leader>t
|
||||
require('plugins/testing/neotest-python'),
|
||||
require('plugins/testing/nvim-neotest'),
|
||||
|
||||
--####################
|
||||
--# - Fun and Style
|
||||
--####################
|
||||
-- Fun
|
||||
require('plugins/fun/cellular-automation'),
|
||||
|
||||
-- Style
|
||||
require('plugins/catppuccin'),
|
||||
}, {
|
||||
ui = {
|
||||
icons = vim.g.have_nerd_font and {} or {
|
||||
cmd = '⌘',
|
||||
config = '🛠',
|
||||
event = '📅',
|
||||
ft = '📂',
|
||||
init = '⚙',
|
||||
keys = '🗝',
|
||||
plugin = '🔌',
|
||||
runtime = '💻',
|
||||
require = '🌙',
|
||||
source = '📄',
|
||||
start = '🚀',
|
||||
task = '📌',
|
||||
lazy = '💤 ',
|
||||
},
|
||||
},
|
||||
}, {
|
||||
rocks = {
|
||||
hererocks = true,
|
||||
},
|
||||
})
|
|
@ -0,0 +1,16 @@
|
|||
-- Catppuccin Theme
|
||||
--- A soothing pastel theme for neovim.
|
||||
return {
|
||||
"catppuccin/nvim",
|
||||
tag = 'v1.6.0',
|
||||
|
||||
name = "catppuccin",
|
||||
|
||||
lazy = false,
|
||||
priority = 1000,
|
||||
-- Colorschemes should force-load at high priority.
|
||||
|
||||
config = function()
|
||||
vim.cmd('colorscheme catppuccin')
|
||||
end
|
||||
}
|
|
@ -0,0 +1,88 @@
|
|||
return {
|
||||
'saghen/blink.cmp',
|
||||
version = 'v0.11.0',
|
||||
lazy = false,
|
||||
|
||||
priority = 1002,
|
||||
|
||||
opts = {
|
||||
completion = {
|
||||
trigger = {
|
||||
show_in_snippet = false,
|
||||
},
|
||||
list = {
|
||||
selection = {
|
||||
preselect = true,
|
||||
auto_insert = false,
|
||||
},
|
||||
},
|
||||
menu = {
|
||||
auto_show = false,
|
||||
},
|
||||
documentation = {
|
||||
auto_show = true,
|
||||
auto_show_delay_ms = 0,
|
||||
},
|
||||
ghost_text = {
|
||||
enabled = true,
|
||||
},
|
||||
},
|
||||
sources = {
|
||||
default = { 'lsp', 'path', 'buffer' },
|
||||
},
|
||||
signature = { enabled = true },
|
||||
keymap = {
|
||||
preset = 'none',
|
||||
|
||||
['<C-h>'] = {
|
||||
'snippet_backward',
|
||||
'cancel',
|
||||
},
|
||||
['<C-u>'] = {
|
||||
function(cmp)
|
||||
if vim.snippet.active() then
|
||||
cmp.accept()
|
||||
vim.snippet.stop()
|
||||
return 1 -- Something non-nil prevents cmp.show()
|
||||
end
|
||||
end,
|
||||
function(cmp) cmp.show({ providers = { 'snippets' } }) end,
|
||||
},
|
||||
['<C-j>'] = {
|
||||
'select_next',
|
||||
},
|
||||
['<C-k>'] = {
|
||||
'show',
|
||||
'select_prev',
|
||||
},
|
||||
['<C-l>'] = {
|
||||
'snippet_forward',
|
||||
'select_and_accept',
|
||||
},
|
||||
|
||||
--['<CR>'] = { 'accept', 'fallback' },
|
||||
|
||||
['<C-M-j>'] = { 'scroll_documentation_down' },
|
||||
['<C-M-k>'] = { 'scroll_documentation_up' },
|
||||
|
||||
['<Tab>'] = { 'fallback' },
|
||||
['<S-Tab>'] = { 'fallback' },
|
||||
|
||||
--['<C-e>'] = { 'hide' },
|
||||
--['<C-y>'] = { 'select_and_accept' },
|
||||
|
||||
--['<Up>'] = { 'select_prev', 'fallback' },
|
||||
--['<Down>'] = { 'select_next', 'fallback' },
|
||||
--['<C-p>'] = { 'select_prev', 'fallback' },
|
||||
--['<C-n>'] = { 'select_next', 'fallback' },
|
||||
|
||||
--['<C-b>'] = { 'scroll_documentation_up', 'fallback' },
|
||||
--['<C-f>'] = { 'scroll_documentation_down', 'fallback' },
|
||||
|
||||
--['<Tab>'] = { 'snippet_forward', 'fallback' },
|
||||
--['<S-Tab>'] = { 'snippet_backward', 'fallback' },
|
||||
|
||||
--['<C-k>'] = { 'show_signature', 'hide_signature', 'fallback' },
|
||||
},
|
||||
},
|
||||
}
|
|
@ -0,0 +1,5 @@
|
|||
return {
|
||||
"rafamadriz/friendly-snippets",
|
||||
commit = "efff286dd74c22f731cdec26a70b46e5b203c619",
|
||||
lazy = false,
|
||||
}
|
|
@ -0,0 +1,30 @@
|
|||
return {
|
||||
"mfussenegger/nvim-dap",
|
||||
commit = "b4f27d451c187de912fa8d3229025a952917eb9e",
|
||||
lazy = true,
|
||||
|
||||
--dependencies = {
|
||||
-- { "rcarriga/nvim-dap-ui", opts = {} },
|
||||
-- { "theHamsta/nvim-dap-virtual-text", opts = {} },
|
||||
--},
|
||||
|
||||
keys = {
|
||||
{ "<leader>dB", function() require("dap").set_breakpoint(vim.fn.input('Breakpoint condition: ')) end, desc = "Breakpoint Condition" },
|
||||
{ "<leader>db", function() require("dap").toggle_breakpoint() end, desc = "Toggle Breakpoint" },
|
||||
{ "<leader>dc", function() require("dap").continue() end, desc = "Run/Continue" },
|
||||
{ "<leader>da", function() require("dap").continue({ before = get_args }) end, desc = "Run with Args" },
|
||||
{ "<leader>dC", function() require("dap").run_to_cursor() end, desc = "Run to Cursor" },
|
||||
{ "<leader>dg", function() require("dap").goto_() end, desc = "Go to Line (No Execute)" },
|
||||
{ "<leader>di", function() require("dap").step_into() end, desc = "Step Into" },
|
||||
{ "<leader>dj", function() require("dap").down() end, desc = "Down" },
|
||||
{ "<leader>dk", function() require("dap").up() end, desc = "Up" },
|
||||
{ "<leader>dl", function() require("dap").run_last() end, desc = "Run Last" },
|
||||
{ "<leader>do", function() require("dap").step_out() end, desc = "Step Out" },
|
||||
{ "<leader>dO", function() require("dap").step_over() end, desc = "Step Over" },
|
||||
{ "<leader>dP", function() require("dap").pause() end, desc = "Pause" },
|
||||
{ "<leader>dr", function() require("dap").repl.toggle() end, desc = "Toggle REPL" },
|
||||
{ "<leader>ds", function() require("dap").session() end, desc = "Session" },
|
||||
{ "<leader>dt", function() require("dap").terminate() end, desc = "Terminate" },
|
||||
{ "<leader>dw", function() require("dap.ui.widgets").hover() end, desc = "Widgets" },
|
||||
},
|
||||
}
|
|
@ -0,0 +1,45 @@
|
|||
return {
|
||||
'stevearc/conform.nvim',
|
||||
commit = "363243c03102a531a8203311d4f2ae704c620d9b",
|
||||
lazy = true,
|
||||
|
||||
cmd = { "ConformInfo" },
|
||||
|
||||
init = function()
|
||||
vim.treesitter.language.register("markdown", { "quarto", "rmd" })
|
||||
end,
|
||||
|
||||
opts = {
|
||||
formatters_by_ft = {
|
||||
python = { 'ruff_format', 'ruff_organize_imports' },
|
||||
--python = { 'ruff_format' },
|
||||
quarto = { 'injected' },
|
||||
},
|
||||
default_format_opts = {
|
||||
lsp_format = 'fallback',
|
||||
},
|
||||
formatters = {
|
||||
injected = {
|
||||
options = {
|
||||
ignore_errors = false,
|
||||
lang_to_ext = {
|
||||
bash = 'sh',
|
||||
c_sharp = 'cs',
|
||||
elixir = 'exs',
|
||||
javascript = 'js',
|
||||
julia = 'jl',
|
||||
latex = 'tex',
|
||||
markdown = 'md',
|
||||
python = 'py',
|
||||
ruby = 'rb',
|
||||
rust = 'rs',
|
||||
teal = 'tl',
|
||||
r = 'r',
|
||||
typescript = 'ts',
|
||||
},
|
||||
lang_to_formatters = {},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
|
@ -0,0 +1,253 @@
|
|||
-- nvim-treesitter
|
||||
--- Interface to the AST-level parser generator 'tree-sitter', enabling operations on source code that intelligently understand the syntax.
|
||||
--- Out of the box, grammer-aware code highlighting, indentation, etc. .
|
||||
--- Base for a lot of other plugins that rely on these kinds of features.
|
||||
|
||||
--- TODO: Look into extensions for:
|
||||
--- * Text Objects: https://github.com/nvim-treesitter/nvim-treesitter-textobjects
|
||||
--- As always, consult <http://www.lazyvim.org/plugins/treesitter>
|
||||
|
||||
return {
|
||||
'nvim-treesitter/nvim-treesitter',
|
||||
commit = 'cfc6f2c117aaaa82f19bcce44deec2c194d900ab',
|
||||
|
||||
dependencies = {
|
||||
{
|
||||
'nvim-treesitter/nvim-treesitter-textobjects',
|
||||
commit = 'ad8f0a472148c3e0ae9851e26a722ee4e29b1595',
|
||||
},
|
||||
},
|
||||
|
||||
build = ':TSUpdate all', -- Update lang parsers unconditionally on build
|
||||
|
||||
lazy = vim.fn.argc(-1) == 0, -- Load early only when opening file w/cmdline
|
||||
event = {
|
||||
'VeryLazy',
|
||||
},
|
||||
cmd = {
|
||||
"TSUpdateSync",
|
||||
"TSUpdate",
|
||||
"TSInstall",
|
||||
},
|
||||
init = function(plugin)
|
||||
--- Many plugins apparently no longer require("nvim-treesitter").
|
||||
--- This messes with the lazy-loading logic.
|
||||
--- However, such plugins only otherwise use custom queries (seems to be called "RTP").
|
||||
--- We therefore register treesitter w/RTP, so such queries will load treesitter.
|
||||
require("lazy.core.loader").add_to_rtp(plugin)
|
||||
require("nvim-treesitter.query_predicates")
|
||||
end,
|
||||
|
||||
opts = {
|
||||
-- Grammer-Aware Syntax Highlighting
|
||||
highlight = {
|
||||
enable = true
|
||||
},
|
||||
|
||||
-- Grammer-Aware Indentation
|
||||
--- TODO: EXPERIMENTAL - CAREFUL!
|
||||
--indent = { enable = true },
|
||||
|
||||
textobjects = {
|
||||
select = {
|
||||
enable = true,
|
||||
lookahead = false,
|
||||
keymaps = {
|
||||
-- You can use the capture groups defined in textobjects.scm
|
||||
["af"] = {
|
||||
query = "@function.outer",
|
||||
desc = "Select [A]round [F]unction",
|
||||
},
|
||||
["if"] = {
|
||||
query = "@function.inner",
|
||||
desc = "Select [I]nside [F]unction",
|
||||
},
|
||||
["al"] = {
|
||||
query = "@class.outer",
|
||||
desc = "Select [A]round C[L]ass",
|
||||
},
|
||||
["il"] = {
|
||||
query = "@class.outer",
|
||||
desc = "Select [I]nside C[L]ass",
|
||||
},
|
||||
["ac"] = {
|
||||
query = "@cell.outer",
|
||||
desc = "Select [A]round [C]ell",
|
||||
},
|
||||
["ic"] = {
|
||||
query = "@cell.inner",
|
||||
desc = "Select [I]nside [C]ell",
|
||||
},
|
||||
},
|
||||
},
|
||||
move = {
|
||||
enable = true,
|
||||
set_jumps = true,
|
||||
}
|
||||
},
|
||||
|
||||
-- Always Install Parsers for Languages
|
||||
ensure_installed = {
|
||||
"ada",
|
||||
"arduino",
|
||||
"asm",
|
||||
"awk",
|
||||
"bash",
|
||||
"bibtex",
|
||||
"c",
|
||||
"c_sharp",
|
||||
"clojure",
|
||||
"cmake",
|
||||
"comment",
|
||||
"commonlisp",
|
||||
"cpp",
|
||||
"css",
|
||||
"csv",
|
||||
"cuda",
|
||||
"d",
|
||||
"dart",
|
||||
"diff",
|
||||
"disassembly",
|
||||
"dockerfile",
|
||||
"dot",
|
||||
"doxygen",
|
||||
"dtd",
|
||||
"editorconfig",
|
||||
"eex",
|
||||
"elixir",
|
||||
"elm",
|
||||
"erlang",
|
||||
"fennel",
|
||||
"fish",
|
||||
"forth",
|
||||
"fortran",
|
||||
"fsh",
|
||||
"fsharp",
|
||||
"gap",
|
||||
"gdscript",
|
||||
"gdshader",
|
||||
"git_config",
|
||||
"git_rebase",
|
||||
"gitattributes",
|
||||
"gitcommit",
|
||||
"gitignore",
|
||||
"gleam",
|
||||
"glsl",
|
||||
"gnuplot",
|
||||
"go",
|
||||
"gpg",
|
||||
"graphql",
|
||||
"haskell",
|
||||
"hcl",
|
||||
"hlsl",
|
||||
"hlsplaylist",
|
||||
"html",
|
||||
"htmldjango",
|
||||
"hyprlang",
|
||||
"ini",
|
||||
"java",
|
||||
"javascript",
|
||||
"jq",
|
||||
"jsdoc",
|
||||
"json",
|
||||
"json5",
|
||||
"jsonc",
|
||||
"jsonnet",
|
||||
"julia",
|
||||
"just",
|
||||
"kconfig",
|
||||
"kdl",
|
||||
"latex",
|
||||
"llvm",
|
||||
"lua",
|
||||
"luadoc",
|
||||
"luap",
|
||||
"luau",
|
||||
"m68k",
|
||||
"make",
|
||||
"markdown",
|
||||
"markdown_inline",
|
||||
"matlab",
|
||||
"meson",
|
||||
"mlir",
|
||||
"nasm",
|
||||
"nginx",
|
||||
"nix",
|
||||
"objc",
|
||||
"objdump",
|
||||
"ocaml",
|
||||
"pascal",
|
||||
"pem",
|
||||
"perl",
|
||||
"php",
|
||||
"phpdoc",
|
||||
"po",
|
||||
"pod",
|
||||
"powershell",
|
||||
"printf",
|
||||
"prisma",
|
||||
"prolog",
|
||||
"promql",
|
||||
"proto",
|
||||
"puppet",
|
||||
"pymanifest",
|
||||
"python",
|
||||
"qmldir",
|
||||
"qmljs",
|
||||
"r",
|
||||
"readline",
|
||||
"regex",
|
||||
"requirements",
|
||||
"robots",
|
||||
"rst",
|
||||
"ruby",
|
||||
"rust",
|
||||
"scala",
|
||||
"scss",
|
||||
"sflog",
|
||||
"smithy",
|
||||
"sql",
|
||||
"ssh_config",
|
||||
"starlark",
|
||||
"strace",
|
||||
"svelte",
|
||||
"swift",
|
||||
"t32",
|
||||
"tablegen",
|
||||
"tcl",
|
||||
"teal",
|
||||
"terraform",
|
||||
"tmux",
|
||||
"todotxt",
|
||||
"toml",
|
||||
"tsv",
|
||||
"tsx",
|
||||
"turtle",
|
||||
"typescript",
|
||||
"typespec",
|
||||
"typst",
|
||||
"udev",
|
||||
"unison",
|
||||
"usd",
|
||||
"vala",
|
||||
"verilog",
|
||||
"vim",
|
||||
"vimdoc",
|
||||
"vue",
|
||||
"wgsl",
|
||||
"wgsl_bevy",
|
||||
"xml",
|
||||
"xresources",
|
||||
"yaml",
|
||||
"zathurarc",
|
||||
"zig",
|
||||
},
|
||||
},
|
||||
config = function(_, opts)
|
||||
require('nvim-treesitter.configs').setup(opts)
|
||||
|
||||
-- Use Treesitter as the Folding Method
|
||||
--vim.opt.foldmethod = "expr"
|
||||
--vim.opt.foldexpr = "nvim_treesitter#foldexpr()"
|
||||
end,
|
||||
}
|
|
@ -0,0 +1,40 @@
|
|||
-- cellular-automaton.nvim
|
||||
--- Purely fun little plugin that animates the buffer text.
|
||||
|
||||
--- TODO: I think bufferline is conflicting (looks all flashy n shit)
|
||||
return {
|
||||
'eandrju/cellular-automaton.nvim',
|
||||
commit = '11aea08aa084f9d523b0142c2cd9441b8ede09ed',
|
||||
|
||||
lazy = true,
|
||||
keys = {
|
||||
{
|
||||
"<leader>fml",
|
||||
function()
|
||||
require('cellular-automaton').start_animation('make_it_rain')
|
||||
end,
|
||||
"n",
|
||||
},
|
||||
{
|
||||
"<leader>fuck",
|
||||
function()
|
||||
require('cellular-automaton').start_animation('scramble')
|
||||
end,
|
||||
"n",
|
||||
},
|
||||
{
|
||||
"<leader>fuck",
|
||||
function()
|
||||
require('cellular-automaton').start_animation('game_of_life')
|
||||
end,
|
||||
"n",
|
||||
},
|
||||
{
|
||||
"<leader>FUCK",
|
||||
function()
|
||||
require('cellular-automaton').start_animation('game_of_life')
|
||||
end,
|
||||
"n",
|
||||
},
|
||||
},
|
||||
}
|
|
@ -0,0 +1,26 @@
|
|||
return {
|
||||
"HakonHarnes/img-clip.nvim",
|
||||
commit = '5ded6f468d633ccfb315905fe8901d6c95ae8f29',
|
||||
event = 'VeryLazy',
|
||||
|
||||
cmd = {
|
||||
'PasteImage',
|
||||
'ImgClipDebug',
|
||||
'ImgClipConfig',
|
||||
},
|
||||
|
||||
keys = {
|
||||
-- Pasting
|
||||
{
|
||||
'<leader>pi',
|
||||
function()
|
||||
require('img-clip').paste_image()
|
||||
end,
|
||||
desc = '[P]aste [I]mage',
|
||||
},
|
||||
},
|
||||
|
||||
opts = {
|
||||
dir_path = 'img',
|
||||
},
|
||||
}
|
|
@ -0,0 +1,32 @@
|
|||
return {
|
||||
'Thiago4532/mdmath.nvim',
|
||||
commit = '699acb27fd34bfdf92a43ce0abdd17f0c7a948fe',
|
||||
opts = {
|
||||
filetypes = { 'markdown', 'quarto' },
|
||||
dynamic = true,
|
||||
dynamic_scale = 0.75,
|
||||
},
|
||||
|
||||
cmd = {
|
||||
'MdMath',
|
||||
},
|
||||
|
||||
keys = {
|
||||
{
|
||||
'<leader>ue',
|
||||
function()
|
||||
require('mdmath').enable()
|
||||
end,
|
||||
'n',
|
||||
desc = 'Enable [U]I [E]quations',
|
||||
},
|
||||
{
|
||||
'<leader>uE',
|
||||
function()
|
||||
require('mdmath').disable()
|
||||
end,
|
||||
'n',
|
||||
desc = 'Disable [U]I [E]quations',
|
||||
},
|
||||
},
|
||||
}
|
|
@ -0,0 +1,74 @@
|
|||
return {
|
||||
'benlubas/molten-nvim',
|
||||
commit = "a286aa914d9a154bc359131aab788b5a077a5a99",
|
||||
build = ":UpdateRemotePlugins",
|
||||
lazy = false,
|
||||
|
||||
--cmd = {
|
||||
-- 'MoltenInfo',
|
||||
-- 'MoltenInit',
|
||||
-- 'MoltenDeinit',
|
||||
-- 'MoltenGoto',
|
||||
-- 'MoltenNext',
|
||||
-- 'MoltenPrev',
|
||||
-- 'MoltenEvaluateLine',
|
||||
-- 'MoltenEvaluateVisual',
|
||||
-- 'MoltenEvaluateOperator',
|
||||
-- 'MoltenEvaluateArgument',
|
||||
-- 'MoltenReevaluateCell',
|
||||
-- 'MoltenDelete',
|
||||
-- 'MoltenShowOutput',
|
||||
-- 'MoltenHideOutput',
|
||||
-- 'MoltenEnterOutput',
|
||||
-- 'MoltenInterrupt',
|
||||
-- 'MoltenOpenInBrowser',
|
||||
-- 'MoltenImagePopup',
|
||||
-- 'MoltenRestart',
|
||||
-- 'MoltenSave',
|
||||
-- 'MoltenLoad',
|
||||
-- 'MoltenExportOutput',
|
||||
-- 'MoltenImportOutput',
|
||||
--},
|
||||
|
||||
keys = {
|
||||
{
|
||||
'<leader>ji',
|
||||
function()
|
||||
vim.ui.input({
|
||||
prompt = 'Enter Jupyter Server URL:'
|
||||
}, function(input)
|
||||
if input then
|
||||
vim.cmd(':MoltenInit ' .. input)
|
||||
end
|
||||
end)
|
||||
end,
|
||||
desc = "[J]upyter [I]nitialize",
|
||||
},
|
||||
{
|
||||
'<leader>jo',
|
||||
':noautocmd MoltenEnterOutput<CR>',
|
||||
silent = true,
|
||||
desc = "[J]upyter [I]nitialize"
|
||||
},
|
||||
{
|
||||
'<leader>jO',
|
||||
':MoltenOpenInBrowser<CR>',
|
||||
silent = true,
|
||||
desc = "[J]upyter [I]nitialize"
|
||||
},
|
||||
|
||||
},
|
||||
|
||||
init = function()
|
||||
-- Configuration
|
||||
vim.g.molten_image_provider = "image.nvim"
|
||||
vim.g.molten_output_win_max_height = 12
|
||||
--vim.g.molten_auto_open_output = false
|
||||
vim.g.molten_auto_init_behavior = 'raise'
|
||||
vim.g.molten_virt_text_output = true
|
||||
vim.g.molten_image_location = 'float'
|
||||
--vim.g.molten_output_show_more = true
|
||||
vim.g.molten_output_virt_lines = false
|
||||
vim.g.molten_use_border_highlights = true
|
||||
end,
|
||||
}
|
|
@ -0,0 +1,16 @@
|
|||
return {
|
||||
'jbyuki/nabla.nvim',
|
||||
commit = '27a6ea9ed7452bb9e0b19eb0942b5bcf7d051b2f',
|
||||
lazy = true,
|
||||
|
||||
keys = {
|
||||
{
|
||||
'<C-6>',
|
||||
function()
|
||||
require('nabla').popup({ close_events = { 'InsertLeave' } })
|
||||
end,
|
||||
mode = { 'i' },
|
||||
desc = 'Toggle [U]I [E]quations',
|
||||
},
|
||||
}
|
||||
}
|
|
@ -0,0 +1,12 @@
|
|||
return {
|
||||
'jmbuhr/otter.nvim',
|
||||
commit = "0e42fa795c35c7190935e3beda3791189c41bb72",
|
||||
lazy = true,
|
||||
|
||||
opts = {
|
||||
buffers = {
|
||||
set_filetype = true,
|
||||
write_to_disk = true,
|
||||
},
|
||||
},
|
||||
}
|
|
@ -0,0 +1,140 @@
|
|||
return {
|
||||
--"quarto-dev/quarto-nvim",
|
||||
dir = vim.env.HOME .. '/comps/neovim/quarto-nvim',
|
||||
commit = "f98937b5be953b27757088e392ce6ccdb16898e5",
|
||||
lazy = true,
|
||||
|
||||
cmd = {
|
||||
'QuartoPreview',
|
||||
'QuartoPreviewNoWatch',
|
||||
'QuartoUpdatePreview',
|
||||
'QuartoClosePreview',
|
||||
'QuartoActivate',
|
||||
'QuartoHelp',
|
||||
'QuartoSend',
|
||||
'QuartoSendAbove',
|
||||
'QuartoSendBelow',
|
||||
'QuartoSendAll',
|
||||
'QuartoSendRange',
|
||||
'QuartoSendLine',
|
||||
},
|
||||
|
||||
keys = {
|
||||
{
|
||||
']c',
|
||||
function()
|
||||
require('nvim-treesitter.textobjects.move').goto_next_start(
|
||||
'@cell.inner',
|
||||
'textobjects'
|
||||
)
|
||||
end,
|
||||
desc = "Goto Next [C]ell Start"
|
||||
},
|
||||
{
|
||||
'[c',
|
||||
function()
|
||||
require('nvim-treesitter.textobjects.move').goto_previous_start(
|
||||
'@cell.inner',
|
||||
'textobjects'
|
||||
)
|
||||
end,
|
||||
desc = "Goto Prev [C]ell Start"
|
||||
},
|
||||
{
|
||||
']C',
|
||||
function()
|
||||
require('nvim-treesitter.textobjects.move').goto_next_end(
|
||||
'@cell.outer',
|
||||
'textobjects'
|
||||
)
|
||||
end,
|
||||
desc = "Goto Next [C]ell End"
|
||||
},
|
||||
{
|
||||
'[C',
|
||||
function()
|
||||
require('nvim-treesitter.textobjects.move').goto_previous_end(
|
||||
'@cell.outer',
|
||||
'textobjects'
|
||||
)
|
||||
end,
|
||||
desc = "Goto Prev [C]ell End"
|
||||
},
|
||||
-- Jupyter / Notebooks
|
||||
--- <leader>j
|
||||
{
|
||||
'<leader>jl',
|
||||
function()
|
||||
require('quarto.runner').run_cell()
|
||||
--vim.cmd(':noautocmd MoltenEnterOutput')
|
||||
end,
|
||||
desc = "[J]upyter Run Ce[L]l",
|
||||
silent = true,
|
||||
},
|
||||
{
|
||||
'<leader>jL',
|
||||
function()
|
||||
require('quarto.runner').run_cell()
|
||||
vim.cmd(':MoltenOpenInBrowser')
|
||||
end,
|
||||
desc = "[J]upyter Run Ce[L]l"
|
||||
},
|
||||
{
|
||||
'<leader>j;',
|
||||
function()
|
||||
require('quarto.runner').run_cell()
|
||||
require('nvim-treesitter.textobjects.move').goto_next_start(
|
||||
'@cell.inner',
|
||||
'textobjects'
|
||||
)
|
||||
end,
|
||||
desc = "[J]upyter Run Cell and Skip"
|
||||
},
|
||||
{
|
||||
'<leader>jk',
|
||||
function() require('quarto.runner').run_above() end,
|
||||
desc = "[J]upyter Run Cell Above"
|
||||
},
|
||||
{
|
||||
'<leader>jA',
|
||||
function() require('quarto.runner').run_all() end,
|
||||
desc = "[J]upyter Run Cell Below"
|
||||
},
|
||||
{
|
||||
'<leader>j,',
|
||||
function() require('quarto.runner').run_line() end,
|
||||
desc = "[J]upyter Run L[I]ne"
|
||||
},
|
||||
{
|
||||
'<leader>jp',
|
||||
function() require('quarto').quartoPreview() end,
|
||||
desc = "[J]upyter Start [P]review"
|
||||
},
|
||||
{
|
||||
'<leader>jP',
|
||||
function() require('quarto').quartoStopPreview() end,
|
||||
desc = "[J]upyter Stop [P]review"
|
||||
},
|
||||
|
||||
},
|
||||
|
||||
init = function()
|
||||
vim.treesitter.language.register("markdown", { "quarto", "rmd" })
|
||||
|
||||
vim.api.nvim_create_autocmd('FileType', {
|
||||
pattern = { 'quarto' },
|
||||
callback = function(ev)
|
||||
require('quarto').activate()
|
||||
end
|
||||
})
|
||||
end,
|
||||
|
||||
opts = {
|
||||
venv = {
|
||||
enabled = true,
|
||||
},
|
||||
codeRunner = {
|
||||
default_method = 'molten',
|
||||
},
|
||||
},
|
||||
}
|
|
@ -0,0 +1,27 @@
|
|||
return {
|
||||
'MeanderingProgrammer/render-markdown.nvim',
|
||||
commit = '17a77463f945c4b9e4f371c752efd90e3e1bf604',
|
||||
|
||||
ft = { 'markdown', 'quarto' },
|
||||
|
||||
opts = {
|
||||
file_types = { 'markdown', 'quarto' },
|
||||
latex = { enabled = false },
|
||||
win_options = { conceallevel = { rendered = 2 } },
|
||||
heading = {
|
||||
},
|
||||
code = {
|
||||
position = 'right',
|
||||
width = 'block',
|
||||
min_width = 25,
|
||||
|
||||
border = 'none',
|
||||
},
|
||||
--on = {
|
||||
-- attach = function()
|
||||
-- require('nabla').enable_virt({ autogen = true })
|
||||
-- vim.o.wrap = true
|
||||
-- end,
|
||||
--},
|
||||
},
|
||||
}
|
|
@ -0,0 +1,28 @@
|
|||
return {
|
||||
"3rd/image.nvim",
|
||||
commit = "7704e1d03d952393774dc7d00a98d8e127086ba4",
|
||||
--commit = "301de7919b2c0378cb7a782663f67abbcb198b17",
|
||||
lazy = false,
|
||||
|
||||
cmd = {
|
||||
'ImageReport',
|
||||
},
|
||||
|
||||
opts = {
|
||||
backend = "kitty",
|
||||
processor = "magick_rock",
|
||||
integrations = {
|
||||
markdown = {
|
||||
only_render_image_at_cursor = true,
|
||||
--floating_windows = true,
|
||||
filetypes = { "markdown", "quarto" },
|
||||
},
|
||||
},
|
||||
max_width = 100,
|
||||
max_height = 12,
|
||||
max_height_window_percentage = math.huge,
|
||||
max_width_window_percentage = math.huge,
|
||||
window_overlap_clear_enabled = true,
|
||||
window_overlap_clear_ft_ignore = { "cmp_menu", "cmp_docs", "" },
|
||||
}
|
||||
}
|
|
@ -0,0 +1,5 @@
|
|||
return {
|
||||
'MunifTanjim/nui.nvim',
|
||||
commit = "53e907ffe5eedebdca1cd503b00aa8692068ca46",
|
||||
lazy = true,
|
||||
}
|
|
@ -0,0 +1,5 @@
|
|||
return {
|
||||
"nvim-neotest/nvim-nio",
|
||||
commit = "21f5324bfac14e22ba26553caf69ec76ae8a7662",
|
||||
lazy = true,
|
||||
}
|
|
@ -0,0 +1,5 @@
|
|||
return {
|
||||
'rcarriga/nvim-notify',
|
||||
commit = '22f29093eae7785773ee9d543f8750348b1a195c',
|
||||
lazy = true,
|
||||
}
|
|
@ -0,0 +1,12 @@
|
|||
-- nvim-web-devicons
|
||||
-- NERD fonts for neovim plugins.
|
||||
return {
|
||||
'nvim-tree/nvim-web-devicons',
|
||||
commit = '5740b7382429d20b6ed0bbdb0694185af9507d44',
|
||||
lazy = false,
|
||||
priority = 1001,
|
||||
|
||||
-- REQ: telescope
|
||||
|
||||
enabled = vim.g.have_nerd_font,
|
||||
}
|
|
@ -0,0 +1,7 @@
|
|||
-- plenary.nvim
|
||||
--- Essentially, a collection of "lua functions the author didn't want to write twice".
|
||||
return {
|
||||
'nvim-lua/plenary.nvim',
|
||||
commit = '2d9b06177a975543726ce5c73fca176cedbffe9d',
|
||||
lazy = true,
|
||||
}
|
|
@ -0,0 +1,44 @@
|
|||
local function close_floats()
|
||||
for _, win in ipairs(vim.api.nvim_list_wins()) do
|
||||
if vim.api.nvim_win_get_config(win).relative == "win" then
|
||||
vim.api.nvim_win_close(win, false)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
return {
|
||||
"https://git.sr.ht/~whynothugo/lsp_lines.nvim",
|
||||
commit = 'a92c755f182b89ea91bd8a6a2227208026f27b4d',
|
||||
lazy = false,
|
||||
|
||||
keys = {
|
||||
{
|
||||
'<leader>df',
|
||||
function()
|
||||
require("lsp_lines").toggle()
|
||||
|
||||
if vim.diagnostic.config().virtual_lines then
|
||||
close_floats()
|
||||
else
|
||||
vim.diagnostic.open_float()
|
||||
end
|
||||
end,
|
||||
desc = 'Toggle [D]ebug [L]ines',
|
||||
},
|
||||
{
|
||||
'<Esc>',
|
||||
function()
|
||||
close_floats()
|
||||
end,
|
||||
desc = 'Close [F]loats',
|
||||
},
|
||||
},
|
||||
|
||||
init = function()
|
||||
vim.diagnostic.config({ virtual_text = false })
|
||||
--vim.diagnostic.config({ virtual_text = false, virtual_lines = { only_current_line = true } })
|
||||
--vim.diagnostic.config({ virtual_text = false, virtual_lines = { only_current_line = true }, })
|
||||
end,
|
||||
|
||||
opts = {}
|
||||
}
|
|
@ -0,0 +1,9 @@
|
|||
-- tiny-code-action
|
||||
--- Simple code-action visualization with telescope
|
||||
return {
|
||||
"rachartier/tiny-code-action.nvim",
|
||||
lazy = true,
|
||||
opts = {
|
||||
backend = "vim",
|
||||
},
|
||||
}
|
|
@ -0,0 +1,145 @@
|
|||
-- fzf-lua.nvim
|
||||
--- Configurable fuzzy finder w/UI.
|
||||
--- See <https://github.com/ibhagwan/fzf-lua> for commands.
|
||||
|
||||
-- REQ[sys]: fd-find
|
||||
-- REQ[sys]: ripgrep
|
||||
-- REQ[sys]: bat
|
||||
-- REQ[sys]: git-delta
|
||||
|
||||
return {
|
||||
'ibhagwan/fzf-lua',
|
||||
commit = 'e3fefd97875827e47dc4bbf1074ee464b2d8e6a8',
|
||||
lazy = true,
|
||||
|
||||
cmd = {
|
||||
"Telescope",
|
||||
},
|
||||
|
||||
keys = {
|
||||
-- Accessibility
|
||||
{
|
||||
'<leader>s?',
|
||||
function() require('fzf-lua').builtin() end,
|
||||
'n',
|
||||
desc = '[S]earch Search-Commands',
|
||||
},
|
||||
{
|
||||
'<leader>sh',
|
||||
function() require('fzf-lua').helptags() end,
|
||||
'n',
|
||||
desc = '[S]earch [H]elp Tags',
|
||||
},
|
||||
{
|
||||
'<leader>sk',
|
||||
function() require('fzf-lua').keymaps() end,
|
||||
'n',
|
||||
desc = '[S]earch [K]eymaps',
|
||||
},
|
||||
{
|
||||
'<leader>sc',
|
||||
function() require('fzf-lua').commands() end,
|
||||
'n',
|
||||
desc = '[S]earch [C]ommands',
|
||||
},
|
||||
{
|
||||
'<leader>sm',
|
||||
function() require('fzf-lua').manpages() end,
|
||||
'n',
|
||||
desc = '[S]earch [M]anpages',
|
||||
},
|
||||
|
||||
-- Grep
|
||||
{
|
||||
'<leader>sg',
|
||||
function() require('fzf-lua').live_grep() end,
|
||||
'n',
|
||||
desc = '[S]earch w/[G]rep',
|
||||
},
|
||||
|
||||
-- Buffer / File Search
|
||||
{
|
||||
'<leader>sb',
|
||||
function() require('fzf-lua').buffers() end,
|
||||
'n',
|
||||
desc = '[S]earch [B]uffers',
|
||||
},
|
||||
{
|
||||
'<leader>sf',
|
||||
function() require('fzf-lua').files() end,
|
||||
'n',
|
||||
desc = '[S]earch [F]iles',
|
||||
},
|
||||
|
||||
-- Git: "VCS" -> "v"
|
||||
{
|
||||
'<leader>sgc',
|
||||
function() require('fzf-lua').git_commits() end,
|
||||
'n',
|
||||
desc = '[S]earch Git [C]ommits',
|
||||
},
|
||||
{
|
||||
'<leader>sgs',
|
||||
function() require('fzf-lua').git_status() end,
|
||||
'n',
|
||||
desc = '[S]earch Git [S]tatus',
|
||||
},
|
||||
|
||||
-- Debug
|
||||
{
|
||||
"<leader>sd",
|
||||
function() require('fzf-lua').diagnostics_document() end,
|
||||
'n',
|
||||
desc = '[S]earch [D]iagnostics',
|
||||
},
|
||||
|
||||
-- Vim
|
||||
{
|
||||
"<leader>s'",
|
||||
function() require('fzf-lua').registers() end,
|
||||
'n',
|
||||
desc = '[S]earch Vim Registers',
|
||||
},
|
||||
},
|
||||
|
||||
opts = {
|
||||
fzf_bin = 'sk',
|
||||
keymap = {
|
||||
builtin = {
|
||||
["<c-b>"] = "preview-page-up",
|
||||
["<c-f>"] = "preview-page-down",
|
||||
},
|
||||
fzf = {
|
||||
["ctrl-u"] = "half-page-up",
|
||||
["ctrl-d"] = "half-page-down",
|
||||
["ctrl-b"] = "preview-page-up",
|
||||
["ctrl-f"] = "preview-page-down",
|
||||
},
|
||||
},
|
||||
previewers = {
|
||||
builtin = {
|
||||
extensions = {
|
||||
["png"] = { "chafa", "{file}" },
|
||||
["jpg"] = { "chafa", "{file}" },
|
||||
["jpeg"] = { "chafa", "{file}" },
|
||||
["gif"] = { "chafa", "{file}" },
|
||||
["svg"] = { "chafa", "{file}" },
|
||||
["webp"] = { "chafa", "{file}" },
|
||||
},
|
||||
},
|
||||
},
|
||||
winopts = {
|
||||
width = 0.8,
|
||||
height = 0.8,
|
||||
row = 0.5,
|
||||
col = 0.5,
|
||||
preview = {
|
||||
scrollchars = { "┃", "" },
|
||||
},
|
||||
},
|
||||
fzf_colors = true,
|
||||
fzf_opts = {
|
||||
["--no-scrollbar"] = true,
|
||||
},
|
||||
},
|
||||
}
|
|
@ -0,0 +1,68 @@
|
|||
return {
|
||||
"folke/snacks.nvim",
|
||||
commit = "b773368f8aa6e84a68e979f0e335d23de71f405a",
|
||||
lazy = false,
|
||||
priority = 1000,
|
||||
|
||||
keys = {
|
||||
{
|
||||
"<c-w>d",
|
||||
function() require('snacks').bufdelete() end,
|
||||
desc = "Delete Current Buffer",
|
||||
},
|
||||
|
||||
-- UX
|
||||
--- <leader>u
|
||||
{
|
||||
"<leader>ud",
|
||||
function() require('snacks').dim() end,
|
||||
desc = "[U]I [D]imming",
|
||||
},
|
||||
{
|
||||
"<leader>us",
|
||||
function() require('snacks').dim.disable() end,
|
||||
desc = "Disable [U]I Dimming",
|
||||
},
|
||||
{
|
||||
"<leader>uz",
|
||||
function() require('snacks').zen() end,
|
||||
desc = "[U]I [Z]en Mode",
|
||||
},
|
||||
},
|
||||
|
||||
opts = {
|
||||
-- Big Files: Disable LSPs for Very Big Files
|
||||
bigfile = {},
|
||||
|
||||
-- Dashboard: Pretty Startup
|
||||
dashboard = {},
|
||||
|
||||
-- Dim: Focus on the Active Scope
|
||||
dim = {},
|
||||
|
||||
-- Indent: Indentation Guides
|
||||
indent = {
|
||||
animate = {
|
||||
enabled = false,
|
||||
}
|
||||
},
|
||||
|
||||
-- Input: Better vim.ui.input
|
||||
input = { enabled = true },
|
||||
|
||||
-- TODO: git (for the blame line)
|
||||
-- TODO: gitbrowse
|
||||
-- TODO: lazygit
|
||||
|
||||
-- Notifier: Prettier notifications
|
||||
--notifier = { enabled = true },
|
||||
|
||||
-- Quickfile: Load files first (aka fast) when doing 'nvim file.txt'
|
||||
quickfile = { enabled = true },
|
||||
|
||||
-- TODO: 'rename' w/nvim-tree integration
|
||||
|
||||
-- "Zen Mode"
|
||||
zen = { enabled = true },
|
||||
},
|
||||
}
|
|
@ -0,0 +1,5 @@
|
|||
return {
|
||||
"nvim-neotest/neotest-python",
|
||||
commit = "a2861ab3c9a0bf75a56b11835c2bfc8270f5be7e",
|
||||
lazy = true,
|
||||
}
|
|
@ -0,0 +1,29 @@
|
|||
return {
|
||||
"nvim-neotest/neotest",
|
||||
commit = "d66cf4e05a116957f0d3a7755a24291c7d1e1f72",
|
||||
lazy = true,
|
||||
|
||||
opts = function(_, _)
|
||||
return {
|
||||
adapters = {
|
||||
require("neotest-python")
|
||||
},
|
||||
}
|
||||
end,
|
||||
keys = {
|
||||
{
|
||||
"<leader>t",
|
||||
"",
|
||||
desc = "+test"
|
||||
},
|
||||
{ "<leader>tt", function() require("neotest").run.run(vim.fn.expand("%")) end, desc = "Run File (Neotest)" },
|
||||
{ "<leader>tT", function() require("neotest").run.run(vim.uv.cwd()) end, desc = "Run All Test Files (Neotest)" },
|
||||
{ "<leader>tr", function() require("neotest").run.run() end, desc = "Run Nearest (Neotest)" },
|
||||
{ "<leader>tl", function() require("neotest").run.run_last() end, desc = "Run Last (Neotest)" },
|
||||
{ "<leader>ts", function() require("neotest").summary.toggle() end, desc = "Toggle Summary (Neotest)" },
|
||||
{ "<leader>to", function() require("neotest").output.open({ enter = true, auto_close = true }) end, desc = "Show Output (Neotest)" },
|
||||
{ "<leader>tO", function() require("neotest").output_panel.toggle() end, desc = "Toggle Output Panel (Neotest)" },
|
||||
{ "<leader>tS", function() require("neotest").run.stop() end, desc = "Stop (Neotest)" },
|
||||
{ "<leader>tw", function() require("neotest").watch.toggle(vim.fn.expand("%")) end, desc = "Toggle Watch (Neotest)" },
|
||||
},
|
||||
}
|
|
@ -0,0 +1,13 @@
|
|||
-- willothy/flatten.nvim
|
||||
--- Makes nvim's embedded terminal play nice with nvim.
|
||||
--- Seriously awesome. Ex. pipe anything into | nvim to open in a new buffer.
|
||||
--- See https://github.com/willothy/flatten.nvim
|
||||
return {
|
||||
"willothy/flatten.nvim",
|
||||
commit = "b17a3e65c2e4e2ecd1345a2d08435e80f982c4a6",
|
||||
lazy = false,
|
||||
priority = 1001,
|
||||
|
||||
opts = {},
|
||||
-- TODO: Rethink which buffer is used for opening / piping.
|
||||
}
|
|
@ -0,0 +1,30 @@
|
|||
return {
|
||||
"folke/noice.nvim",
|
||||
event = "VeryLazy",
|
||||
opts = {
|
||||
cmdline = { enabled = false },
|
||||
messages = { enabled = false },
|
||||
popupmenu = { enabled = false },
|
||||
redirect = { enabled = false },
|
||||
notify = { enabled = false },
|
||||
lsp = {
|
||||
progress = { enabled = false },
|
||||
override = {
|
||||
["vim.lsp.util.convert_input_to_markdown_lines"] = true,
|
||||
["vim.lsp.util.stylize_markdown"] = true,
|
||||
},
|
||||
hover = { enabled = true },
|
||||
signature = { enabled = true },
|
||||
message = { enabled = false },
|
||||
},
|
||||
--presets = {
|
||||
-- command_palette = true,
|
||||
--},
|
||||
--cmdline = {
|
||||
-- format = {
|
||||
-- --cmdline = { pattern = "^:", icon = "", lang = "vim" },
|
||||
-- cmdline = { pattern = "^:", icon = ":", lang = "vim" },
|
||||
-- },
|
||||
--},
|
||||
},
|
||||
}
|
|
@ -0,0 +1,4 @@
|
|||
-- Vim Sleuth
|
||||
--- Detect tabstop and shiftwidth automatically
|
||||
|
||||
return 'tpope/vim-sleuth'
|
|
@ -0,0 +1,8 @@
|
|||
-- which-key.nvim
|
||||
--- Whenever a key is pressed, display possible key bindings of what is being typed.
|
||||
--- Automatically reads the desc attribute of custom key bindings.
|
||||
return {
|
||||
"folke/which-key.nvim",
|
||||
commit = '0e76a87ac51772569aec678dc74baa8e2a86100c',
|
||||
event = 'VeryLazy',
|
||||
}
|
|
@ -0,0 +1,111 @@
|
|||
-- gitsigns.nvim
|
||||
--- Displays git changes in the sidebar, configurably and efficiently.
|
||||
--- See `:help gitsigns`
|
||||
return {
|
||||
'lewis6991/gitsigns.nvim',
|
||||
commit = '9b36d497495436c135659902054ee637e0ba6021',
|
||||
event = 'VeryLazy',
|
||||
lazy = false,
|
||||
-- See: https://github.com/lewis6991/gitsigns.nvim/issues/796
|
||||
|
||||
opts = {
|
||||
numhl = true,
|
||||
|
||||
on_attach = function(buf)
|
||||
-- Hunk Navigation
|
||||
vim.keymap.set(
|
||||
'n',
|
||||
']g',
|
||||
function()
|
||||
if vim.wo.diff then
|
||||
vim.cmd.normal({ ']c', bang = true })
|
||||
else
|
||||
require('gitsigns').nav_hunk('next')
|
||||
end
|
||||
end,
|
||||
{ buffer = buf, desc = 'Next [G]it Change' }
|
||||
)
|
||||
vim.keymap.set(
|
||||
'n',
|
||||
'[g',
|
||||
function()
|
||||
if vim.wo.diff then
|
||||
vim.cmd.normal({ '[c', bang = true })
|
||||
else
|
||||
require('gitsigns').nav_hunk('prev')
|
||||
end
|
||||
end,
|
||||
{ buffer = buf, desc = 'Prev [G]it Change' }
|
||||
)
|
||||
|
||||
-- Hunk Preview
|
||||
vim.keymap.set(
|
||||
'n',
|
||||
'<leader>gp',
|
||||
function() require('gitsigns').preview_hunk() end,
|
||||
{ buffer = buf, desc = '[G]it [P]review Hunk' }
|
||||
)
|
||||
|
||||
-- Buffer Staging / Unstaging
|
||||
vim.keymap.set(
|
||||
'n',
|
||||
'<leader>gs',
|
||||
function() require('gitsigns').stage_buffer() end,
|
||||
{ buffer = buf, desc = '[G]it [S]tage Buffer' }
|
||||
)
|
||||
vim.keymap.set(
|
||||
'n',
|
||||
'<leader>gS',
|
||||
function() require('gitsigns').reset_buffer_index() end,
|
||||
{ buffer = buf, desc = '[G]it Unstage Buffer' }
|
||||
)
|
||||
|
||||
-- Hunk Staging
|
||||
vim.keymap.set(
|
||||
'n',
|
||||
'<leader>gh',
|
||||
function() require('gitsigns').stage_hunk() end,
|
||||
{ buffer = buf, desc = '[G]it Hunk [S]tage Toggle' }
|
||||
)
|
||||
|
||||
-- Restoration
|
||||
vim.keymap.set(
|
||||
'n',
|
||||
'<leader>gr',
|
||||
function()
|
||||
require('gitsigns').reset_hunk()
|
||||
end,
|
||||
{ buffer = buf, desc = '[G]it [R]estore Hunk' }
|
||||
)
|
||||
vim.keymap.set(
|
||||
'n',
|
||||
'<leader>gR',
|
||||
function()
|
||||
local choice = vim.fn.confirm(
|
||||
"Delete all unstaged changes in this buffer?",
|
||||
"&Yes\n&No",
|
||||
2
|
||||
)
|
||||
if choice == 1 then
|
||||
require('gitsigns').reset_buffer()
|
||||
end
|
||||
end,
|
||||
{ buffer = buf, desc = '[G]it [R]estore Buffer' }
|
||||
)
|
||||
|
||||
vim.keymap.set(
|
||||
'n',
|
||||
'<leader>ga',
|
||||
function()
|
||||
require('gitsigns').toggle_linehl()
|
||||
require('gitsigns').toggle_word_diff()
|
||||
end,
|
||||
{ buffer = buf, desc = '[G]it [A]nalysis Toggle' }
|
||||
)
|
||||
|
||||
|
||||
-- TODO: Shortcut for opening lazygit in a new :term.
|
||||
--- Perhaps even in a new tab?
|
||||
end,
|
||||
}
|
||||
}
|
|
@ -0,0 +1,29 @@
|
|||
return {
|
||||
'echasnovski/mini.files',
|
||||
commit = '0db8f49088bcefff23c5cb8498a6c94e46a45a8e',
|
||||
lazy = true,
|
||||
|
||||
keys = {
|
||||
{
|
||||
'<leader>fd',
|
||||
function()
|
||||
if not require('mini.files').close() then
|
||||
require('mini.files').open()
|
||||
end
|
||||
end,
|
||||
'n',
|
||||
desc = '[F]ile Browser'
|
||||
},
|
||||
},
|
||||
|
||||
opts = {
|
||||
mapping = {
|
||||
close = { 'q', '<leader>fd' },
|
||||
go_in_plus = '',
|
||||
go_out_plus = '',
|
||||
},
|
||||
windows = {
|
||||
preview = false,
|
||||
},
|
||||
},
|
||||
}
|
|
@ -0,0 +1,30 @@
|
|||
-- neovim-project
|
||||
--- Lightweight workspace, project and session manager.
|
||||
|
||||
-- Utilities
|
||||
return {
|
||||
"coffebar/neovim-project",
|
||||
opts = {
|
||||
projects = { -- define project roots
|
||||
"~/src/*",
|
||||
"~/.config/*",
|
||||
},
|
||||
picker = {
|
||||
type = "telescope", -- or "fzf-lua"
|
||||
}
|
||||
},
|
||||
init = function()
|
||||
-- enable saving the state of plugins in the session
|
||||
vim.opt.sessionoptions:append("globals") -- save global variables that start with an uppercase letter and contain at least one lowercase letter.
|
||||
end,
|
||||
dependencies = {
|
||||
{ "nvim-lua/plenary.nvim" },
|
||||
-- optional picker
|
||||
{ "nvim-telescope/telescope.nvim", tag = "0.1.4" },
|
||||
-- optional picker
|
||||
{ "ibhagwan/fzf-lua" },
|
||||
{ "Shatur/neovim-session-manager" },
|
||||
},
|
||||
lazy = false,
|
||||
priority = 100,
|
||||
}
|
|
@ -0,0 +1,124 @@
|
|||
-- projections.nvim
|
||||
--- Lightweight workspace, project and session manager.
|
||||
|
||||
local startswith = function(text, prefix)
|
||||
return text:find(prefix, 1, true) == 1
|
||||
end
|
||||
|
||||
local function store_session()
|
||||
local cwd = vim.loop.cwd()
|
||||
if cwd and require('projections.session').info(cwd) then
|
||||
require('projections.session').store(cwd)
|
||||
end
|
||||
end
|
||||
|
||||
-- Plugin
|
||||
return {
|
||||
'gnikdroy/projections.nvim',
|
||||
commit = '889914169fa1f5c00fb8659653b5a8330fb223e6',
|
||||
lazy = true,
|
||||
|
||||
dependencies = {
|
||||
{
|
||||
'nyngwang/fzf-lua-projections.nvim',
|
||||
commit = '411672ab6f7c38d3a4a51916fda1a01c1618ae04',
|
||||
},
|
||||
},
|
||||
|
||||
keys = {
|
||||
{
|
||||
"<leader>sp",
|
||||
function()
|
||||
require('fzf-lua-p').projects()
|
||||
end,
|
||||
"n",
|
||||
},
|
||||
},
|
||||
|
||||
init = function()
|
||||
vim.opt.sessionoptions = 'blank,buffers,folds,globals,help,localoptions,resize,tabpages,terminal'
|
||||
|
||||
--####################
|
||||
--# - Store Session on Close Vim
|
||||
--####################
|
||||
vim.api.nvim_create_autocmd({ 'VimLeavePre' }, {
|
||||
callback = store_session,
|
||||
})
|
||||
|
||||
--####################
|
||||
--# - Store Session on Timer
|
||||
--####################
|
||||
vim.api.nvim_create_autocmd({ 'BufWritePre' }, {
|
||||
callback = store_session,
|
||||
})
|
||||
--local timer = vim.uv.new_timer()
|
||||
--timer:start(1000, 1000, vim.schedule_wrap(store_session))
|
||||
|
||||
--####################
|
||||
--# - Restore Session on Open Vim
|
||||
--####################
|
||||
vim.api.nvim_create_autocmd({ 'VimEnter' }, {
|
||||
callback = function()
|
||||
local workspaces = require("projections.workspace").get_workspaces()
|
||||
|
||||
local cwd = vim.loop.cwd()
|
||||
if not cwd then return end
|
||||
|
||||
-- If Currently Within a Project, CD to that Project
|
||||
for _, ws in ipairs(workspaces) do
|
||||
for _, project in ipairs(ws:projects()) do
|
||||
local path_project = project:path().path
|
||||
if startswith(cwd, path_project) then
|
||||
vim.cmd('cd ' .. path_project)
|
||||
end
|
||||
end
|
||||
end
|
||||
if not cwd then return end
|
||||
|
||||
-- If Path was Opened: Retrieve That Path
|
||||
local path_opened_file = nil
|
||||
if next(vim.fn.argv()) then
|
||||
path_opened_file = vim.fn.argv(0)
|
||||
end
|
||||
|
||||
-- If CWD is a Project: Restore Project Session
|
||||
cwd = vim.loop.cwd()
|
||||
local session_info = require('projections.session').info(cwd)
|
||||
if session_info ~= nil then
|
||||
require('projections.session').restore(cwd)
|
||||
end
|
||||
|
||||
-- If Originally Opened w/File, Open it Now
|
||||
--- This makes sure that, although we restored the session...
|
||||
--- ...the file requested to edit will still be opened for editing.
|
||||
if path_opened_file ~= nil then
|
||||
vim.cmd('e ' .. path_opened_file)
|
||||
end
|
||||
-- TODO: Perhaps we need to question the user a little more about what they want.
|
||||
end
|
||||
})
|
||||
end,
|
||||
|
||||
opts = {
|
||||
-- Default Workspaces
|
||||
--- Any folder with a '.git' within a workspace is a 'project'.
|
||||
workspaces = {
|
||||
-- General
|
||||
{ '~/src', { '.git' } },
|
||||
-- Specific
|
||||
--- Blender
|
||||
{ '~/src/blender', { '.git' } },
|
||||
--- College
|
||||
{ '~/src/college/bsc', { ".active_course" } },
|
||||
{ '~/src/college/msc', { ".active_course" } },
|
||||
--- Infrastructures
|
||||
{ '~/src/infras/clusters', { '.git' } },
|
||||
--- Photonics
|
||||
{ '~/src/photonics/books', { '.git' } },
|
||||
{ '~/src/photonics/packages', { '.git' } },
|
||||
--- Neovim
|
||||
{ "~/comps/neovim", { '.git' } },
|
||||
{ "~/.config", { 'nvim.version' } },
|
||||
},
|
||||
},
|
||||
}
|
|
@ -0,0 +1,2 @@
|
|||
-- [[ User Commands ]]
|
||||
-- See `:help lua-guide-autocommands`
|
|
@ -0,0 +1 @@
|
|||
e4a58a7ca03457668492f8f41189ea2f23700172
|
Loading…
Reference in New Issue