Compare commits

..
7 Commits
Author SHA1 Message Date
marco fabc3362a1 rework keymaps and plugin config
- Change leader from space to comma
- Move opencode keymaps into plugin config
- Move picker keymaps from <leader>p to <leader>f
- Change buffer delete mapping from bd to bk
- Add DAP debugging keymaps and dap-view
- Remove zk-nvim, checkmate plugins
- Add claude-code, conjure, scnvim plugins
- Update LSP servers: replace basedpyright with ty, add gopls/clojure_lsp/harper_ls/tinymist
- Enable inlay hints on LspAttach
- Enable go/sql/typst tree-sitter
- Add htmlhint formatter
- Configure opencode with snacks terminal
2026-08-02 17:09:21 +02:00
marco 35f0723076 Add opencode and notes/todo configuration 2026-02-27 10:29:46 +01:00
marco ae2297dfbb Cleanup useless plugins 2026-02-27 10:28:59 +01:00
marco b76bcd6f8d Auto-update the file when changed 2026-02-27 10:28:25 +01:00
marco a90177c992 No highligh on search 2026-02-12 08:55:38 +01:00
marco bebc330458 Add zk-nvim configuration 2026-02-12 08:54:42 +01:00
marco 842f5fa367 Change key binds for picker 2026-02-10 11:10:00 +01:00
5 changed files with 233 additions and 214 deletions
+8
View File
@@ -0,0 +1,8 @@
{
"plugins": {
"scnvim": {
"rev": "876732590ef3f409c9705f3659fa1061db2dc7bf",
"src": "https://github.com/davidgranstrom/scnvim"
}
}
}
+4 -2
View File
@@ -16,7 +16,7 @@
-- reading. Consider preserving this or remove `-- stylua` lines to autoformat. -- reading. Consider preserving this or remove `-- stylua` lines to autoformat.
-- General ==================================================================== -- General ====================================================================
vim.g.mapleader = ' ' -- Use `<Space>` as <Leader> key vim.g.mapleader = ',' -- Use comma as <Leader> key
vim.o.mouse = 'a' -- Enable mouse vim.o.mouse = 'a' -- Enable mouse
vim.o.mousescroll = 'ver:25,hor:6' -- Customize mouse scroll vim.o.mousescroll = 'ver:25,hor:6' -- Customize mouse scroll
@@ -46,7 +46,9 @@ vim.o.splitbelow = true -- Horizontal splits will be below
vim.o.splitkeep = 'screen' -- Reduce scroll during window split vim.o.splitkeep = 'screen' -- Reduce scroll during window split
vim.o.splitright = true -- Vertical splits will be to the right vim.o.splitright = true -- Vertical splits will be to the right
vim.o.winborder = 'rounded' -- Use border in floating windows vim.o.winborder = 'rounded' -- Use border in floating windows
vim.o.wrap = false -- Don't visually wrap lines (toggle with \w) vim.o.wrap = false -- Visually wrap lines (toggle with \w)
vim.o.hls = false
vim.o.autoread = true
vim.o.cursorlineopt = 'screenline,number' -- Show cursor line per screen line vim.o.cursorlineopt = 'screenline,number' -- Show cursor line per screen line
+55 -83
View File
@@ -14,13 +14,6 @@ local nmap = function(lhs, rhs, desc)
vim.keymap.set('n', lhs, rhs, { desc = desc }) vim.keymap.set('n', lhs, rhs, { desc = desc })
end end
-- Paste linewise before/after current line
-- Usage: `yiw` to yank a word and `]p` to put it on the next line.
nmap('[p', '<Cmd>exe "put! " . v:register<CR>', 'Paste Above')
nmap(']p', '<Cmd>exe "put " . v:register<CR>', 'Paste Below')
-- Many general mappings are created by 'mini.basics'. See 'plugin/30_mini.lua'
-- stylua: ignore start -- stylua: ignore start
-- The next part (until `-- stylua: ignore end`) is aligned manually for easier -- The next part (until `-- stylua: ignore end`) is aligned manually for easier
-- reading. Consider preserving this or remove `-- stylua` lines to autoformat. -- reading. Consider preserving this or remove `-- stylua` lines to autoformat.
@@ -38,23 +31,18 @@ nmap(']p', '<Cmd>exe "put " . v:register<CR>', 'Paste Below')
-- This is used to provide 'mini.clue' with extra clues. -- This is used to provide 'mini.clue' with extra clues.
-- Add an entry if you create a new group. -- Add an entry if you create a new group.
_G.Config.leader_group_clues = { _G.Config.leader_group_clues = {
{ mode = 'n', keys = '<Leader>a', desc = '+AI' },
{ mode = 'n', keys = '<Leader>b', desc = '+Buffer' }, { mode = 'n', keys = '<Leader>b', desc = '+Buffer' },
{ mode = 'n', keys = '<Leader>e', desc = '+Explore/Edit' }, { mode = 'n', keys = '<Leader>e', desc = '+Explore/Edit' },
{ mode = 'n', keys = '<Leader>f', desc = '+Find' }, { mode = 'n', keys = '<Leader>f', desc = '+Pick' },
{ mode = 'n', keys = '<Leader>g', desc = '+Git' }, { mode = 'n', keys = '<Leader>g', desc = '+Git' },
{ mode = 'n', keys = '<Leader>l', desc = '+Language' }, { mode = 'n', keys = '<Leader>l', desc = '+Language' },
{ mode = 'n', keys = '<Leader>m', desc = '+Map' }, { mode = 'n', keys = '<Leader>m', desc = '+Map' },
{ mode = 'n', keys = '<Leader>o', desc = '+Other' }, { mode = 'n', keys = '<Leader>o', desc = '+Other' },
{ mode = 'n', keys = '<Leader>s', desc = '+Session' }, { mode = 'n', keys = '<Leader>s', desc = '+Session' },
{ mode = 'n', keys = '<Leader>t', desc = '+Terminal' },
{ mode = 'x', keys = '<Leader>g', desc = '+Git' }, { mode = 'x', keys = '<Leader>g', desc = '+Git' },
{ mode = 'x', keys = '<Leader>z', desc = '+Notes' },
} }
-- Comodities
vim.keymap.set({'n', 'x'}, '<Leader>y', '"y', { desc = "Yank" })
vim.keymap.set({'n', 'x'}, '<Leader>d', '"d', { desc = "Cut" })
-- Helpers for a more concise `<Leader>` mappings. -- Helpers for a more concise `<Leader>` mappings.
-- Most of the mappings use `<Cmd>...<CR>` string as a right hand side (RHS) in -- Most of the mappings use `<Cmd>...<CR>` string as a right hand side (RHS) in
-- an attempt to be more concise yet descriptive. See `:h <Cmd>`. -- an attempt to be more concise yet descriptive. See `:h <Cmd>`.
@@ -63,14 +51,14 @@ vim.keymap.set({'n', 'x'}, '<Leader>d', '"d', { desc = "Cut" })
local nmap_leader = function(suffix, rhs, desc) local nmap_leader = function(suffix, rhs, desc)
vim.keymap.set('n', '<Leader>' .. suffix, rhs, { desc = desc }) vim.keymap.set('n', '<Leader>' .. suffix, rhs, { desc = desc })
end end
local xmap_leader = function(suffix, rhs, desc) local xmap_leader = function(suffix, rhs, desc)
vim.keymap.set('x', '<Leader>' .. suffix, rhs, { desc = desc }) vim.keymap.set('x', '<Leader>' .. suffix, rhs, { desc = desc })
end end
-- a is for 'AI' local vmap_leader = function(suffix, rhs, desc)
nmap_leader('ac', ':ClaudeCode<CR>', 'Toggle Claude') vim.keymap.set('v', '<Leader>' .. suffix, rhs, { desc = desc })
nmap_leader('af', ':ClaudeCodeFocus<CR>', 'Focus Claude') end
nmap_leader('ar', ':ClaudeCode --resume<CR>', 'Resume Claude')
-- b is for 'Buffer'. Common usage: -- b is for 'Buffer'. Common usage:
-- - `<Leader>bs` - create scratch (temporary) buffer -- - `<Leader>bs` - create scratch (temporary) buffer
@@ -80,11 +68,11 @@ local new_scratch_buffer = function()
vim.api.nvim_win_set_buf(0, vim.api.nvim_create_buf(true, true)) vim.api.nvim_win_set_buf(0, vim.api.nvim_create_buf(true, true))
end end
nmap_leader('ba', '<Cmd>b#<CR>', 'Alternate') nmap_leader('ba', '<Cmd>b#<CR>', 'Alternate')
nmap_leader('bd', '<Cmd>lua MiniBufremove.delete()<CR>', 'Delete') nmap_leader('bk', '<Cmd>lua MiniBufremove.delete()<CR>', 'Kill')
nmap_leader('bD', '<Cmd>lua MiniBufremove.delete(0, true)<CR>', 'Delete!') nmap_leader('bK', '<Cmd>lua MiniBufremove.delete(0, true)<CR>', 'KIIIILLL!')
nmap_leader('bs', new_scratch_buffer, 'Scratch') nmap_leader('bs', new_scratch_buffer, 'Scratch')
nmap_leader('bw', '<Cmd>write<CR>', 'Write') nmap_leader('bw', '<Cmd>write<CR>', 'Write')
-- e is for 'Explore' and 'Edit'. Common usage: -- e is for 'Explore' and 'Edit'. Common usage:
-- - `<Leader>ed` - open explorer at current working directory -- - `<Leader>ed` - open explorer at current working directory
@@ -102,15 +90,15 @@ local explore_quickfix = function()
vim.cmd('copen') vim.cmd('copen')
end end
nmap_leader('ed', '<Cmd>lua MiniFiles.open()<CR>', 'Directory') nmap_leader('ed', '<Cmd>lua MiniFiles.open()<CR>', 'Directory')
nmap_leader('ef', explore_at_file, 'File directory') nmap_leader('ef', explore_at_file, 'File directory')
nmap_leader('ei', '<Cmd>edit $MYVIMRC<CR>', 'init.lua') nmap_leader('ei', '<Cmd>edit $MYVIMRC<CR>', 'init.lua')
nmap_leader('ek', edit_plugin_file('20_keymaps.lua'), 'Keymaps config') nmap_leader('ek', edit_plugin_file('20_keymaps.lua'), 'Keymaps config')
nmap_leader('em', edit_plugin_file('30_mini.lua'), 'MINI config') nmap_leader('em', edit_plugin_file('30_mini.lua'), 'MINI config')
nmap_leader('en', '<Cmd>lua MiniNotify.show_history()<CR>', 'Notifications') nmap_leader('en', '<Cmd>lua MiniNotify.show_history()<CR>', 'Notifications')
nmap_leader('eo', edit_plugin_file('10_options.lua'), 'Options config') nmap_leader('eo', edit_plugin_file('10_options.lua'), 'Options config')
nmap_leader('ep', edit_plugin_file('40_plugins.lua'), 'Plugins config') nmap_leader('ep', edit_plugin_file('40_plugins.lua'), 'Plugins config')
nmap_leader('eq', explore_quickfix, 'Quickfix') nmap_leader('eq', explore_quickfix, 'Quickfix')
-- f is for 'Fuzzy Find'. Common usage: -- f is for 'Fuzzy Find'. Common usage:
-- - `<Leader>ff` - find files; for best performance requires `ripgrep` -- - `<Leader>ff` - find files; for best performance requires `ripgrep`
@@ -122,24 +110,23 @@ nmap_leader('eq', explore_quickfix, 'Quickfix')
-- All these use 'mini.pick'. See `:h MiniPick-overview` for an overview. -- All these use 'mini.pick'. See `:h MiniPick-overview` for an overview.
local pick_workspace_symbols_live = '<Cmd>Pick lsp scope="workspace_symbol_live"<CR>' local pick_workspace_symbols_live = '<Cmd>Pick lsp scope="workspace_symbol_live"<CR>'
nmap_leader('f/', '<Cmd>Pick history scope="/"<CR>', '"/" history') nmap_leader('f/', '<Cmd>Pick history scope="/"<CR>', '"/" history')
nmap_leader('f:', '<Cmd>Pick history scope=":"<CR>', '":" history') nmap_leader('f:', '<Cmd>Pick history scope=":"<CR>', '":" history')
nmap_leader('fb', '<Cmd>Pick buffers<CR>', 'Buffers') nmap_leader('<space>', '<Cmd>Pick buffers<CR>', 'Buffers')
nmap_leader('fd', '<Cmd>Pick diagnostic scope="all"<CR>', 'Diagnostic workspace') nmap_leader('w', '<Cmd>w!<CR>', 'Write buffer')
nmap_leader('fD', '<Cmd>Pick diagnostic scope="current"<CR>', 'Diagnostic buffer') nmap_leader('fd', '<Cmd>Pick diagnostic scope="all"<CR>', 'Diagnostic workspace')
nmap_leader('ff', '<Cmd>Pick files<CR>', 'Files') nmap_leader('fD', '<Cmd>Pick diagnostic scope="current"<CR>', 'Diagnostic buffer')
nmap_leader('fg', '<Cmd>Pick grep_live<CR>', 'Grep live') nmap_leader('ff', '<Cmd>Pick files<CR>', 'Files')
nmap_leader('fG', '<Cmd>Pick grep pattern="<cword>"<CR>', 'Grep current word') nmap_leader('fg', '<Cmd>Pick grep_live<CR>', 'Grep live')
nmap_leader('fh', '<Cmd>Pick help<CR>', 'Help tags') nmap_leader('fG', '<Cmd>Pick grep pattern="<cword>"<CR>', 'Grep current word')
nmap_leader('fH', '<Cmd>Pick hl_groups<CR>', 'Highlight groups') nmap_leader('fh', '<Cmd>Pick help<CR>', 'Help tags')
nmap_leader('fl', '<Cmd>Pick buf_lines scope="all"<CR>', 'Lines (all)') nmap_leader('fH', '<Cmd>Pick hl_groups<CR>', 'Highlight groups')
nmap_leader('fL', '<Cmd>Pick buf_lines scope="current"<CR>', 'Lines (buf)') nmap_leader('fl', '<Cmd>Pick buf_lines scope="all"<CR>', 'Lines (all)')
nmap_leader('fr', '<Cmd>Pick resume<CR>', 'Resume') nmap_leader('fL', '<Cmd>Pick buf_lines scope="current"<CR>', 'Lines (buf)')
nmap_leader('fR', '<Cmd>Pick lsp scope="references"<CR>', 'References (LSP)') nmap_leader('fr', '<Cmd>Pick resume<CR>', 'Resume')
nmap_leader('fs', pick_workspace_symbols_live, 'Symbols workspace (live)') nmap_leader('fR', '<Cmd>Pick lsp scope="references"<CR>', 'References (LSP)')
nmap_leader('fS', '<Cmd>Pick lsp scope="document_symbol"<CR>', 'Symbols document') nmap_leader('fs', pick_workspace_symbols_live, 'Symbols workspace (live)')
nmap_leader('fv', '<Cmd>Pick visit_paths cwd=""<CR>', 'Visit paths (all)') nmap_leader('fS', '<Cmd>Pick lsp scope="document_symbol"<CR>', 'Symbols document')
nmap_leader('fV', '<Cmd>Pick visit_paths<CR>', 'Visit paths (cwd)')
-- g is for Git -- g is for Git
nmap_leader('gg', '<Cmd>Neogit<CR>', 'Open neogit') nmap_leader('gg', '<Cmd>Neogit<CR>', 'Open neogit')
@@ -150,45 +137,30 @@ nmap_leader('gb', '<Cmd>Gitsigns toggle_current_line_blame<CR>', 'Git blame')
-- - `<Leader>ld` - show more diagnostic details in a floating window -- - `<Leader>ld` - show more diagnostic details in a floating window
-- - `<Leader>lr` - perform rename via LSP -- - `<Leader>lr` - perform rename via LSP
-- - `<Leader>ls` - navigate to source definition of symbol under cursor -- - `<Leader>ls` - navigate to source definition of symbol under cursor
--
-- NOTE: most LSP mappings represent a more structured way of replacing built-in
-- LSP mappings (like `:h gra` and others). This is needed because `gr` is mapped
-- by an "replace" operator in 'mini.operators' (which is more commonly used).
local formatting_cmd = '<Cmd>lua require("conform").format({lsp_fallback=true})<CR>'
nmap_leader('la', '<Cmd>lua vim.lsp.buf.code_action()<CR>', 'Actions') nmap_leader('la', '<Cmd>lua vim.lsp.buf.code_action()<CR>', 'Actions')
nmap_leader('ld', '<Cmd>lua vim.diagnostic.open_float()<CR>', 'Diagnostic popup') nmap_leader('ld', '<Cmd>lua vim.diagnostic.open_float()<CR>', 'Diagnostic popup')
nmap_leader('lf', formatting_cmd, 'Format') nmap_leader('lf', '<Cmd>lua vim.lsp.buf.format()<CR>', 'Format')
nmap_leader('li', '<Cmd>lua vim.lsp.buf.implementation()<CR>', 'Implementation') nmap_leader('li', '<Cmd>lua vim.lsp.buf.implementation()<CR>', 'Implementation')
nmap_leader('lh', '<Cmd>lua vim.lsp.buf.hover()<CR>', 'Hover') nmap_leader('lh', '<Cmd>lua vim.lsp.buf.hover()<CR>', 'Hover')
nmap_leader('lr', '<Cmd>lua vim.lsp.buf.rename()<CR>', 'Rename') nmap_leader('lr', '<Cmd>lua vim.lsp.buf.rename()<CR>', 'Rename')
nmap_leader('lR', '<Cmd>lua vim.lsp.buf.references()<CR>', 'References') nmap_leader('lR', '<Cmd>lua vim.lsp.buf.references()<CR>', 'References')
nmap_leader('ls', '<Cmd>lua vim.lsp.buf.definition()<CR>', 'Source definition') nmap_leader('ls', '<Cmd>lua vim.lsp.buf.definition()<CR>', 'Source definition')
nmap_leader('lt', '<Cmd>lua vim.lsp.buf.type_definition()<CR>', 'Type definition') nmap_leader('lt', '<Cmd>lua vim.lsp.buf.type_definition()<CR>', 'Type definition')
xmap_leader('lf', formatting_cmd, 'Format selection') -- d is for DAP Debugging
nmap_leader('dd', '<Cmd>DapViewToggle<CR>', 'Open DAP')
nmap_leader('ds', '<Cmd:>DapContinue<CR>', 'Start or Continue')
nmap_leader('db', '<Cmd:>DapToggleBreakpoint<CR>', 'Toggle Breakpoint')
nmap_leader('di', '<Cmd:>DapStepInto<CR>', 'Toggle Breakpoint')
nmap_leader('db', '<Cmd:>DapToggleBreakpoint<CR>', 'Toggle Breakpoint')
-- o is for 'Other'. Common usage: -- o is for 'Other'. Common usage:
-- - `<Leader>oz` - toggle between "zoomed" and regular view of current buffer -- - `<Leader>oz` - toggle between "zoomed" and regular view of current buffer
nmap_leader('or', '<Cmd>lua MiniMisc.resize_window()<CR>', 'Resize to default width') nmap_leader('ot', '<Cmd>lua MiniTrailspace.trim()<CR>', 'Trim trailspace')
nmap_leader('ot', '<Cmd>lua MiniTrailspace.trim()<CR>', 'Trim trailspace') nmap_leader('oz', '<Cmd>lua MiniMisc.zoom()<CR>', 'Zoom toggle')
nmap_leader('oz', '<Cmd>lua MiniMisc.zoom()<CR>', 'Zoom toggle') nmap_leader('om', '<Cmd>Mason<CR>', 'Open Mason')
nmap_leader('om', '<Cmd>Mason<CR>', 'Open Mason') nmap_leader('ou', '<Cmd>DepsUpdate<CR>', 'Update plugins')
nmap_leader('ou', '<Cmd>DepsUpdate<CR>', 'Update plugins') nmap_leader('or', '<Cmd>Pick registers<CR>', 'Yank from register')
-- s is for 'Session'. Common usage:
-- - `<Leader>sn` - start new session
-- - `<Leader>sr` - read previously started session
-- - `<Leader>sd` - delete previously started session
local session_new = 'MiniSessions.write(vim.fn.input("Session name: "))'
nmap_leader('sd', '<Cmd>lua MiniSessions.select("delete")<CR>', 'Delete')
nmap_leader('sn', '<Cmd>lua ' .. session_new .. '<CR>', 'New')
nmap_leader('sr', '<Cmd>lua MiniSessions.select("read")<CR>', 'Read')
nmap_leader('sw', '<Cmd>lua MiniSessions.write()<CR>', 'Write current')
-- t is for 'Terminal'
nmap_leader('tT', '<Cmd>horizontal term<CR>', 'Terminal (horizontal)')
nmap_leader('tt', '<Cmd>vertical term<CR>', 'Terminal (vertical)')
-- stylua: ignore end -- stylua: ignore end
-91
View File
@@ -88,28 +88,6 @@ end)
-- - `:h MiniNotify.config` for some of common configuration examples. -- - `:h MiniNotify.config` for some of common configuration examples.
now(function() require('mini.notify').setup() end) now(function() require('mini.notify').setup() end)
-- Session management. A thin wrapper around `:h mksession` that consistently
-- manages session files. Example usage:
-- - `<Leader>sn` - start new session
-- - `<Leader>sr` - read previously started session
-- - `<Leader>sd` - delete previously started session
now(function() require('mini.sessions').setup() end)
-- Start screen. This is what is shown when you open Neovim like `nvim`.
-- Example usage:
-- - Type prefix keys to limit available candidates
-- - Navigate down/up with `<C-n>` and `<C-p>`
-- - Press `<CR>` to select an entry
--
-- See also:
-- - `:h MiniStarter-example-config` - non-default config examples
-- - `:h MiniStarter-lifecycle` - how to work with Starter buffer
now(
function()
require('mini.starter').setup({ header = "Remember why you're doing it" })
end
)
-- Statusline. Sets `:h 'statusline'` to show more info in a line below window. -- Statusline. Sets `:h 'statusline'` to show more info in a line below window.
-- See also: -- See also:
-- - `:h MiniStatusline-example-content` - example of default content. Use it to -- - `:h MiniStatusline-example-content` - example of default content. Use it to
@@ -397,75 +375,6 @@ end)
-- one of `<Leader>f` mappings defined in 'plugin/20_keymaps.lua' -- one of `<Leader>f` mappings defined in 'plugin/20_keymaps.lua'
later(function() require('mini.pick').setup() end) later(function() require('mini.pick').setup() end)
-- Manage and expand snippets (templates for a frequently used text).
-- Typical workflow is to type snippet's (configurable) prefix and expand it
-- into a snippet session.
--
-- How to manage snippets:
-- - 'mini.snippets' itself doesn't come with preconfigured snippets. Instead there
-- is a flexible system of how snippets are prepared before expanding.
-- They can come from pre-defined path on disk, 'snippets/' directories inside
-- config or plugins, defined inside `setup()` call directly.
-- - This config, however, does come with snippet configuration:
-- - 'snippets/global.json' is a file with global snippets that will be
-- available in any buffer
-- - 'after/snippets/lua.json' defines personal snippets for Lua language
-- - 'friendly-snippets' plugin configured in 'plugin/40_plugins.lua' provides
-- a collection of language snippets
--
-- How to expand a snippet in Insert mode:
-- - If you know snippet's prefix, type it as a word and press `<C-j>`. Snippet's
-- body should be inserted instead of the prefix.
-- - If you don't remember snippet's prefix, type only part of it (or none at all)
-- and press `<C-j>`. It should show picker with all snippets that have prefixes
-- matching typed characters (or all snippets if none was typed).
-- Choose one and its body should be inserted instead of previously typed text.
--
-- How to navigate during snippet session:
-- - Snippets can contain tabstops - places for user to interactively adjust text.
-- Each tabstop is highlighted depending on session progression - whether tabstop
-- is current, was or was not visited. If tabstop doesn't yet have text, it is
-- visualized with special "ghost" inline text: • and ∎ by default.
-- - Type necessary text at current tabstop and navigate to next/previous one
-- by pressing `<C-l>` / `<C-h>`.
-- - Repeat previous step until you reach special final tabstop, usually denoted
-- by ∎ symbol. If you spotted a mistake in an earlier tabstop, navigate to it
-- and return back to the final tabstop.
-- - To end a snippet session when at final tabstop, keep typing or go into
-- Normal mode. To force end snippet session, press `<C-c>`.
--
-- See also:
-- - `:h MiniSnippets-overview` - overview of how module works
-- - `:h MiniSnippets-examples` - examples of common setups
-- - `:h MiniSnippets-session` - details about snippet session
-- - `:h MiniSnippets.gen_loader` - list of available loaders
-- later(function()
-- -- Define language patterns to work better with 'friendly-snippets'
-- local latex_patterns = { 'latex/**/*.json', '**/latex.json' }
-- local lang_patterns = {
-- tex = latex_patterns,
-- plaintex = latex_patterns,
-- -- Recognize special injected language of markdown tree-sitter parser
-- markdown_inline = { 'markdown.json' },
-- }
--
-- local snippets = require('mini.snippets')
-- local config_path = vim.fn.stdpath('config')
-- snippets.setup({
-- snippets = {
-- -- Always load 'snippets/global.json' from config directory
-- snippets.gen_loader.from_file(config_path .. '/snippets/global.json'),
-- -- Load from 'snippets/' directory of plugins, like 'friendly-snippets'
-- snippets.gen_loader.from_lang({ lang_patterns = lang_patterns }),
-- },
-- })
--
-- -- By default snippets available at cursor are not shown as candidates in
-- -- 'mini.completion' menu. This requires a dedicated in-process LSP server
-- -- that will provide them. To have that, uncomment next line (use `gcc`).
-- -- MiniSnippets.start_lsp_server()
-- end)
-- Surround actions: add/delete/replace/find/highlight. Working with surroundings -- Surround actions: add/delete/replace/find/highlight. Working with surroundings
-- is surprisingly common: surround word with quotes, replace `)` with `]`, etc. -- is surprisingly common: surround word with quotes, replace `)` with `]`, etc.
-- This module comes with many built-in surroundings, each identified by a single -- This module comes with many built-in surroundings, each identified by a single
+165 -37
View File
@@ -13,11 +13,6 @@ local add, later = MiniDeps.add, MiniDeps.later
local now_if_args = _G.Config.now_if_args local now_if_args = _G.Config.now_if_args
-- Tree-sitter ================================================================ -- Tree-sitter ================================================================
-- Tree-sitter is a tool for fast incremental parsing. It converts text into
-- a hierarchical structure (called tree) that can be used to implement advanced
-- and/or more precise actions: syntax highlighting, textobjects, indent, etc.
--
now_if_args(function() now_if_args(function()
add({ add({
source = 'nvim-treesitter/nvim-treesitter', source = 'nvim-treesitter/nvim-treesitter',
@@ -35,13 +30,17 @@ now_if_args(function()
local languages = { local languages = {
-- These are already pre-installed with Neovim. Used as an example. -- These are already pre-installed with Neovim. Used as an example.
'lua', 'lua',
'vimdoc', 'html',
'css',
'markdown', 'markdown',
'yaml', 'yaml',
'toml', 'toml',
'python', 'python',
'javascript', 'javascript',
'typst', 'typst',
'go',
'sql',
'typst',
-- Add here more languages with which you want to use tree-sitter -- Add here more languages with which you want to use tree-sitter
-- To see available languages: -- To see available languages:
-- - Execute `:=require('nvim-treesitter').get_available()` -- - Execute `:=require('nvim-treesitter').get_available()`
@@ -66,48 +65,42 @@ now_if_args(function()
end) end)
-- Language servers =========================================================== -- Language servers ===========================================================
-- Language Server Protocol (LSP) is a set of conventions that power creation of
-- language specific tools. It requires two parts:
-- - Server - program that performs language specific computations.
-- - Client - program that asks server for computations and shows results.
--
-- Add it now if file (and not 'mini.starter') is shown after startup.
now_if_args(function() now_if_args(function()
add('neovim/nvim-lspconfig') add('neovim/nvim-lspconfig')
-- Use `:h vim.lsp.enable()` to automatically enable language server based on
-- the rules provided by 'nvim-lspconfig'.
-- Use `:h vim.lsp.config()` or 'after/lsp/' directory to configure servers.
-- Uncomment and tweak the following `vim.lsp.enable()` call to enable servers.
vim.lsp.enable({ vim.lsp.enable({
'lua_ls', 'lua_ls',
'basedpyright', 'ty',
'ruff', 'ruff',
'html',
'css',
'toml',
'marksman',
'gopls',
'clojure_lsp',
'harper_ls',
'tinymist'
})
vim.api.nvim_create_autocmd('LspAttach', {
callback = function(args)
local client = assert(vim.lsp.get_client_by_id(args.data.client_id))
if client.server_capabilities.inlayHintProvider then
vim.lsp.inlay_hint.enable(true)
end
end,
}) })
end) end)
-- Formatting ================================================================= -- Formatting =================================================================
-- Programs dedicated to text formatting (a.k.a. formatters) are very useful.
-- Neovim has built-in tools for text formatting (see `:h gq` and `:h 'formatprg'`).
-- They can be used to configure external programs, but it might become tedious.
--
-- The 'stevearc/conform.nvim' plugin is a good and maintained solution for easier
-- formatting setup.
later(function() later(function()
add('stevearc/conform.nvim') add('stevearc/conform.nvim')
-- See also:
-- - `:h Conform`
-- - `:h conform-options`
-- - `:h conform-formatters`
require('conform').setup({ require('conform').setup({
-- Map of filetype to formatters -- Map of filetype to formatters
-- Make sure that necessary CLI tool is available -- Make sure that necessary CLI tool is available
formatters_by_ft = { formatters_by_ft = {
lua = { 'stylua' }, lua = { 'stylua' },
python = { 'ruff' } python = { 'ruff' },
html = { 'htmlhint' },
}, },
}) })
end) end)
@@ -120,7 +113,7 @@ end)
-- Catppuccin ================================================================= -- Catppuccin =================================================================
now_if_args(function() now_if_args(function()
add({ source = "catppuccin/nvim", name = "catppuccin" }) add({ source = 'catppuccin/nvim', name = 'catppuccin' })
require('catppuccin').setup({ require('catppuccin').setup({
flavour = 'mocha', flavour = 'mocha',
transparent_background = true, transparent_background = true,
@@ -130,6 +123,7 @@ now_if_args(function()
float = { float = {
transparent = true, transparent = true,
}, },
compile_path = vim.fn.stdpath('cache') .. '/catppuccin',
}) })
vim.cmd('colorscheme catppuccin') vim.cmd('colorscheme catppuccin')
end) end)
@@ -151,12 +145,146 @@ later(function()
require('gitsigns').setup({}) require('gitsigns').setup({})
end) end)
-- claudecode ================================================================= -- opencode ===================================================================
later(function () local opencode_cmd = "opencode --port"
later(function()
add({ add({
source = 'coder/claudecode.nvim', source = 'nickjvandyke/opencode.nvim',
depends = { 'folke/snacks.nvim' }, depends = { 'folke/snacks.nvim' },
}) })
require('claudecode').setup({})
require('snacks').setup({ picker = { enabled = true } })
---@type snacks.terminal.Opts
local snacks_terminal_opts = {
win = {
position = "right",
enter = false,
},
}
---@type opencode.Opts
vim.g.opencode_opts = {
server = {
start = function()
require("snacks.terminal").open(opencode_cmd, snacks_terminal_opts)
end,
},
}
vim.keymap.set({ "n", "x" }, "<leader>aa", function()
require("opencode").ask("@this: ", { submit = true })
end, { desc = "Ask opencode" })
vim.keymap.set({ "n", "x" }, "<leader>ap", function()
require("opencode").select()
end, { desc = "Select opencode" })
vim.keymap.set({ "n", "t" }, "<leader>ac", function()
require("snacks.terminal").toggle(opencode_cmd, snacks_terminal_opts)
end, { desc = "Toggle opencode" })
end)
-- render-markdown.nvim ========================================================
now_if_args(function()
add({
source = 'MeanderingProgrammer/render-markdown.nvim',
})
require('render-markdown').setup({
enabled = true,
file_types = { 'markdown', 'vimwiki' },
latex = { enabled = false }
})
end)
-- nvim-dap ====================================================================
--
later(function()
add({
source = 'mfussenegger/nvim-dap',
depends = {
'nvim-neotest/nvim-nio',
'mfussenegger/nvim-dap-python',
'theHamsta/nvim-dap-virtual-text',
},
})
add({
source = 'igorlfs/nvim-dap-view',
})
local dap = require('dap')
local dap_view = require('dap-view')
local dap_python = require('dap-python')
dap_view.setup({})
require('nvim-dap-virtual-text').setup({
commented = true, -- Show virtual text alongside comment
})
dap_python.setup('python3')
end)
-- claude code =================================================================
now_if_args(function()
add({
source = "coder/claudecode.nvim",
depends = { "folke/snacks.nvim" }
})
require("claudecode").setup()
vim.keymap.set({ "n", "x" }, "<leader>co", "<cmd>ClaudeCode<cr>", { desc = "Open Claude Code" })
end)
-- conjure =====================================================================
later(function()
add({
source = 'Olical/conjure',
})
end end
) )
-- Typst ========================================================================
now_if_args(function()
vim.keymap.set("n", "<leader>tt", "<cmd>LspTinymistExportPdf<cr>", { desc = "Export Typst to PDF" })
end)
-- Supercollider ===============================================================
later(function()
add({
source = 'davidgranstrom/scnvim'
})
local scnvim = require("scnvim")
local map = scnvim.map
local map_expr = scnvim.map_expr
scnvim.setup({
keymaps = {
["<M-e>"] = map("editor.send_line", { "i", "n" }),
["<C-e>"] = {
map("editor.send_block", { "i", "n" }),
map("editor.send_selection", "x"),
},
["<CR>"] = map("postwin.toggle"),
["<M-CR>"] = map("postwin.toggle", "i"),
["<M-L>"] = map("postwin.clear", { "n", "i" }),
["<C-s>"] = map("signature.show", { "n", "i" }),
["<C-.>"] = map("sclang.hard_stop", { "n", "x", "i" }),
["<leader>st"] = map("sclang.start"),
["<leader>sk"] = map("sclang.recompile"),
["<F1>"] = map_expr("s.boot"),
["<F2>"] = map_expr("s.meter"),
},
editor = {
highlight = {
color = "IncSearch",
},
},
postwin = {
float = {
enabled = true,
},
},
})
end)