added latex support and reorg ftplugins
This commit is contained in:
parent
7f1b34fd6f
commit
f2eaf7c67a
38 changed files with 600 additions and 234 deletions
|
|
@ -21,15 +21,19 @@ return {
|
|||
-- Set completion options
|
||||
vim.opt.completeopt = { 'menu', 'menuone', 'noselect' }
|
||||
|
||||
-- Lazy load snippets from friendly-snippets
|
||||
require('luasnip.loaders.from_vscode').lazy_load()
|
||||
|
||||
-- Import required modules
|
||||
local cmp = require('cmp')
|
||||
local luasnip = require('luasnip')
|
||||
|
||||
-- Setup luasnip
|
||||
luasnip.config.setup({})
|
||||
luasnip.config.setup({
|
||||
history = true,
|
||||
updateevents = 'TextChanged,TextChangedI',
|
||||
})
|
||||
|
||||
-- Lazy load snippets from friendly-snippets and custom snippets
|
||||
require('luasnip.loaders.from_vscode').lazy_load()
|
||||
require('luasnip.loaders.from_vscode').load(vim.fn.stdpath('config') .. '/snippets')
|
||||
|
||||
-- Setup nvim-cmp
|
||||
cmp.setup({
|
||||
|
|
@ -90,12 +94,6 @@ return {
|
|||
}),
|
||||
})
|
||||
|
||||
-- Additional luasnip configuration
|
||||
luasnip.config.set_config({
|
||||
history = true,
|
||||
updateevents = 'TextChanged,TextChangedI',
|
||||
})
|
||||
|
||||
-- Setup for SQL filetype with vim-dadbod-completion
|
||||
cmp.setup.filetype('sql', {
|
||||
sources = cmp.config.sources({
|
||||
|
|
|
|||
|
|
@ -16,6 +16,10 @@ return {
|
|||
end
|
||||
end,
|
||||
go = { 'gofumpt', 'goimports' },
|
||||
yaml = { 'prettier' }, -- Added YAML formatter
|
||||
bash = { 'shfmt' }, -- Added Bash formatter
|
||||
rust = { 'rustfmt' }, -- Added Rust formatter
|
||||
dockerfile = { 'hadolint' }, -- Added Dockerfile formatter
|
||||
}
|
||||
|
||||
require('conform').setup({
|
||||
|
|
@ -28,12 +32,15 @@ return {
|
|||
|
||||
require('mason-tool-installer').setup({
|
||||
ensure_installed = {
|
||||
'stylua',
|
||||
'ruff',
|
||||
'isort',
|
||||
'black',
|
||||
'gofumpt',
|
||||
'goimports',
|
||||
'stylua', -- Lua
|
||||
'ruff', -- Python
|
||||
'isort', -- Python
|
||||
'black', -- Python
|
||||
'gofumpt', -- Go
|
||||
'goimports', -- Go
|
||||
'prettier', -- YAML, JSON, etc.
|
||||
'shfmt', -- Bash
|
||||
'hadolint', -- Dockerfile
|
||||
},
|
||||
})
|
||||
end,
|
||||
|
|
|
|||
|
|
@ -1,47 +1,46 @@
|
|||
return {
|
||||
'tpope/vim-fugitive',
|
||||
config = function()
|
||||
vim.keymap.set('n', '<leader>gs', vim.cmd.Git)
|
||||
-- General key mappings for Fugitive
|
||||
vim.keymap.set('n', '<leader>gs', vim.cmd.Git, { desc = 'Open Git status' })
|
||||
|
||||
local jfraeys_fugitive = vim.api.nvim_create_augroup('jfraeys_fugitive', {})
|
||||
-- Create an autocommand group for Fugitive-specific settings
|
||||
local fugitive_augroup = vim.api.nvim_create_augroup('fugitive', { clear = true })
|
||||
|
||||
local autocmd = vim.api.nvim_create_autocmd
|
||||
autocmd('BufWinEnter', {
|
||||
group = jfraeys_fugitive,
|
||||
-- Set up autocommands for Fugitive buffers
|
||||
vim.api.nvim_create_autocmd('BufWinEnter', {
|
||||
group = fugitive_augroup,
|
||||
pattern = '*',
|
||||
callback = function()
|
||||
if vim.bo.ft ~= 'fugitive' then
|
||||
return
|
||||
end
|
||||
if vim.bo.ft ~= 'fugitive' then return end
|
||||
|
||||
local bufnr = vim.api.nvim_get_current_buf()
|
||||
local opts = { buffer = bufnr, remap = false }
|
||||
|
||||
vim.keymap.set('n', '<leader>p', function()
|
||||
vim.cmd.Git 'push'
|
||||
end, opts)
|
||||
|
||||
-- rebase always
|
||||
vim.keymap.set('n', '<leader>P', function()
|
||||
vim.cmd.Git { 'pull', '--rebase' }
|
||||
end, opts)
|
||||
|
||||
-- NOTE: It allows me to easily set the branch I am pushing and any tracking
|
||||
-- needed if I did not set the branch up correctly
|
||||
-- Key mappings specific to Fugitive buffers
|
||||
vim.keymap.set('n', '<leader>p', function() vim.cmd.Git('push') end, opts)
|
||||
vim.keymap.set('n', '<leader>P', function() vim.cmd.Git('pull --rebase') end, opts)
|
||||
vim.keymap.set('n', '<leader>t', ':Git push -u origin ', opts)
|
||||
end,
|
||||
})
|
||||
|
||||
vim.keymap.set('n', 'gu', '<cmd>diffget //2<CR>')
|
||||
vim.keymap.set('n', 'gh', '<cmd>diffget //3<CR>')
|
||||
-- Additional key mappings outside of Fugitive buffers
|
||||
vim.keymap.set('n', 'gu', '<cmd>diffget //2<CR>', { desc = 'Get diff for version 2' })
|
||||
vim.keymap.set('n', 'gh', '<cmd>diffget //3<CR>', { desc = 'Get diff for version 3' })
|
||||
|
||||
-- Set up a faster command for Fugitive in Lua
|
||||
local function git_command(args)
|
||||
local cmd = 'Git ' .. args
|
||||
vim.cmd(cmd)
|
||||
end
|
||||
|
||||
vim.api.nvim_create_user_command('Git', function(params)
|
||||
git_command(params.args)
|
||||
end, { nargs = '*' })
|
||||
end,
|
||||
cond = function()
|
||||
-- Function to check if the current directory is a Git repository
|
||||
local is_git_repo = function()
|
||||
local git_dir = vim.fn.finddir('.git', '.;')
|
||||
return git_dir and #git_dir > 0
|
||||
end
|
||||
return is_git_repo()
|
||||
-- Efficient Git repository check
|
||||
return vim.fn.isdirectory('.git') == 1
|
||||
end,
|
||||
}
|
||||
|
||||
|
|
|
|||
104
lua/custom/plugins/images.lua
Normal file
104
lua/custom/plugins/images.lua
Normal file
|
|
@ -0,0 +1,104 @@
|
|||
return {
|
||||
-- {
|
||||
-- 'vhyrro/luarocks.nvim',
|
||||
-- priority = 1001,
|
||||
-- opts = {
|
||||
-- rocks = { 'magick' },
|
||||
-- },
|
||||
-- event = 'VeryLazy', -- Adjust this based on your needs
|
||||
-- },
|
||||
-- {
|
||||
-- 'willothy/wezterm.nvim',
|
||||
-- config = true,
|
||||
-- event = 'BufWinEnter', -- Or another appropriate event
|
||||
-- },
|
||||
-- {
|
||||
-- '3rd/image.nvim',
|
||||
-- enabled = true,
|
||||
-- commit = 'deb158d',
|
||||
-- dev = false,
|
||||
-- ft = { 'markdown', 'quarto', 'vimwiki' },
|
||||
-- config = function()
|
||||
-- local image = require 'image'
|
||||
-- image.setup {
|
||||
-- backend = 'wezterm',
|
||||
-- integrations = {
|
||||
-- markdown = {
|
||||
-- enabled = true,
|
||||
-- only_render_image_at_cursor = true,
|
||||
-- filetypes = { 'markdown', 'vimwiki', 'quarto' },
|
||||
-- },
|
||||
-- },
|
||||
-- editor_only_render_when_focused = false,
|
||||
-- window_overlap_clear_enabled = true,
|
||||
-- tmux_show_only_in_active_window = true,
|
||||
-- window_overlap_clear_ft_ignore = { 'cmp_menu', 'cmp_docs', 'scrollview', 'scrollview_sign' },
|
||||
-- max_width = nil,
|
||||
-- max_height = nil,
|
||||
-- max_width_window_percentage = nil,
|
||||
-- max_height_window_percentage = 30,
|
||||
-- kitty_method = 'normal',
|
||||
-- }
|
||||
--
|
||||
-- local function clear_all_images()
|
||||
-- local bufnr = vim.api.nvim_get_current_buf()
|
||||
-- local images = image.get_images { buffer = bufnr }
|
||||
-- for _, img in ipairs(images) do
|
||||
-- img:clear()
|
||||
-- end
|
||||
-- end
|
||||
--
|
||||
-- local function get_image_at_cursor(buf)
|
||||
-- local images = image.get_images { buffer = buf }
|
||||
-- local row = vim.api.nvim_win_get_cursor(0)[1] - 1
|
||||
-- for _, img in ipairs(images) do
|
||||
-- if img.geometry ~= nil and img.geometry.y == row then
|
||||
-- local og_max_height = img.global_state.options.max_height_window_percentage
|
||||
-- img.global_state.options.max_height_window_percentage = nil
|
||||
-- return img, og_max_height
|
||||
-- end
|
||||
-- end
|
||||
-- return nil
|
||||
-- end
|
||||
--
|
||||
-- local create_preview_window = function(img, og_max_height)
|
||||
-- local buf = vim.api.nvim_create_buf(false, true)
|
||||
-- local win_width = vim.api.nvim_get_option_value('columns', {})
|
||||
-- local win_height = vim.api.nvim_get_option_value('lines', {})
|
||||
-- local win = vim.api.nvim_open_win(buf, true, {
|
||||
-- relative = 'editor',
|
||||
-- style = 'minimal',
|
||||
-- width = win_width,
|
||||
-- height = win_height,
|
||||
-- row = 0,
|
||||
-- col = 0,
|
||||
-- zindex = 1000,
|
||||
-- })
|
||||
-- vim.keymap.set('n', 'q', function()
|
||||
-- vim.api.nvim_win_close(win, true)
|
||||
-- img.global_state.options.max_height_window_percentage = og_max_height
|
||||
-- end, { buffer = buf })
|
||||
-- return { buf = buf, win = win }
|
||||
-- end
|
||||
--
|
||||
-- local handle_zoom = function(bufnr)
|
||||
-- local img, og_max_height = get_image_at_cursor(bufnr)
|
||||
-- if img == nil then
|
||||
-- return
|
||||
-- end
|
||||
--
|
||||
-- local preview = create_preview_window(img, og_max_height)
|
||||
-- image.hijack_buffer(img.path, preview.win, preview.buf)
|
||||
-- end
|
||||
--
|
||||
-- vim.keymap.set('n', '<leader>io', function()
|
||||
-- local bufnr = vim.api.nvim_get_current_buf()
|
||||
-- handle_zoom(bufnr)
|
||||
-- end, { buffer = true, desc = 'image [o]pen' })
|
||||
--
|
||||
-- vim.keymap.set('n', '<leader>ic', clear_all_images, { desc = 'image [c]lear' })
|
||||
-- end,
|
||||
-- },
|
||||
--
|
||||
}
|
||||
|
||||
|
|
@ -6,14 +6,21 @@ return {
|
|||
'BufNewFile',
|
||||
},
|
||||
config = function()
|
||||
-- Linter configurations based on file type
|
||||
require('lint').linters_by_ft = {
|
||||
python = { 'ruff' },
|
||||
go = { 'golangcilint' },
|
||||
yaml = { 'yamllint' },
|
||||
bash = { 'shellcheck' },
|
||||
lua = { 'luacheck' }, -- Added Lua linter
|
||||
rust = { 'clippy' }, -- Use `clippy` for Rust linting
|
||||
dockerfile = { 'hadolint' }, -- Added Dockerfile linter
|
||||
}
|
||||
|
||||
-- Autocommand group for triggering linting
|
||||
local lint_augroup = vim.api.nvim_create_augroup('lint', { clear = true })
|
||||
|
||||
-- Trigger linting on buffer enter, write, and insert leave
|
||||
vim.api.nvim_create_autocmd({ 'BufEnter', 'BufWritePost', 'InsertLeave' }, {
|
||||
group = lint_augroup,
|
||||
callback = function()
|
||||
|
|
@ -21,17 +28,23 @@ return {
|
|||
end,
|
||||
})
|
||||
|
||||
-- Keybinding to manually lint the current buffer
|
||||
vim.keymap.set('n', '<leader>l', function()
|
||||
require('lint').try_lint()
|
||||
end, { desc = 'Lint the current buffer' })
|
||||
|
||||
-- Mason tool installer setup
|
||||
require('mason-tool-installer').setup({
|
||||
ensure_installed = {
|
||||
'ruff',
|
||||
-- 'mypy',
|
||||
'golangci-lint',
|
||||
'yamllint',
|
||||
'ruff', -- Python
|
||||
-- 'mypy', -- Uncomment if needed for additional Python linting
|
||||
'golangci-lint', -- Go
|
||||
'yamllint', -- YAML
|
||||
'shellcheck', -- Bash
|
||||
'luacheck', -- Lua
|
||||
'hadolint', -- Dockerfile
|
||||
},
|
||||
})
|
||||
end,
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1,7 +1,6 @@
|
|||
return {
|
||||
'neovim/nvim-lspconfig',
|
||||
dependencies = {
|
||||
-- Automatically install LSPs to stdpath for neovim
|
||||
{ 'williamboman/mason.nvim', config = true },
|
||||
'williamboman/mason-lspconfig.nvim',
|
||||
'WhoIsSethDaniel/mason-tool-installer.nvim',
|
||||
|
|
@ -13,77 +12,35 @@ return {
|
|||
opts = {},
|
||||
},
|
||||
|
||||
-- Additional lua configuration, makes nvim stuff amazing!
|
||||
-- Additional Lua configuration
|
||||
'folke/neodev.nvim',
|
||||
},
|
||||
config = function()
|
||||
local on_attach = function(client, bufnr)
|
||||
local nmap = function(keys, func, desc)
|
||||
if desc then
|
||||
desc = 'LSP: ' .. desc
|
||||
end
|
||||
vim.keymap.set('n', keys, func, { buffer = bufnr, desc = desc })
|
||||
end
|
||||
|
||||
-- Key mappings for LSP features
|
||||
nmap('<leader>rn', vim.lsp.buf.rename, '[R]e[n]ame')
|
||||
nmap('<leader>ca', function()
|
||||
vim.lsp.buf.code_action(require('telescope.themes').get_dropdown({
|
||||
winblend = 10,
|
||||
previewer = false,
|
||||
}))
|
||||
end, '[C]ode [A]ction')
|
||||
|
||||
nmap('gd', require('telescope.builtin').lsp_definitions, '[G]oto [D]efinition')
|
||||
nmap('gr', require('telescope.builtin').lsp_references, '[G]oto [R]eferences')
|
||||
nmap('gI', require('telescope.builtin').lsp_implementations, '[G]oto [I]mplementation')
|
||||
nmap('<leader>D', require('telescope.builtin').lsp_type_definitions, 'Type [D]efinition')
|
||||
nmap('<leader>ds', require('telescope.builtin').lsp_document_symbols, '[D]ocument [S]ymbols')
|
||||
nmap('<leader>ws', require('telescope.builtin').lsp_dynamic_workspace_symbols, '[W]orkspace [S]ymbols')
|
||||
|
||||
nmap('K', vim.lsp.buf.hover, 'Hover Documentation')
|
||||
nmap('<C-k>', vim.lsp.buf.signature_help, 'Signature Documentation')
|
||||
|
||||
nmap('gD', vim.lsp.buf.declaration, '[G]oto [D]eclaration')
|
||||
nmap('gv', ':vsplit<CR>:lua vim.lsp.buf.declaration()<CR>', '[G]oto [V]irtual Text')
|
||||
nmap('<leader>wa', vim.lsp.buf.add_workspace_folder, '[W]orkspace [A]dd Folder')
|
||||
nmap('<leader>wr', vim.lsp.buf.remove_workspace_folder, '[W]orkspace [R]emove Folder')
|
||||
nmap('<leader>wl', function()
|
||||
print(vim.inspect(vim.lsp.buf.list_workspace_folders()))
|
||||
end, '[W]orkspace [L]ist Folders')
|
||||
end
|
||||
|
||||
-- General capabilities for LSP servers
|
||||
local capabilities = vim.lsp.protocol.make_client_capabilities()
|
||||
if pcall(require, 'cmp_nvim_lsp') then
|
||||
capabilities = require('cmp_nvim_lsp').default_capabilities()
|
||||
local has_cmp, cmp_nvim_lsp = pcall(require, 'cmp_nvim_lsp')
|
||||
if has_cmp then
|
||||
capabilities = cmp_nvim_lsp.default_capabilities()
|
||||
end
|
||||
|
||||
require('neodev').setup({
|
||||
library = {
|
||||
plugins = { 'nvim-dap-ui' },
|
||||
types = true,
|
||||
},
|
||||
})
|
||||
|
||||
-- LSP server configurations
|
||||
local servers = {
|
||||
bashls = { filetypes = { 'sh', 'bash' } },
|
||||
clangd = {},
|
||||
gopls = {
|
||||
settings = {
|
||||
gopls = {
|
||||
gofumpt = true,
|
||||
staticcheck = true,
|
||||
completeUnimported = true,
|
||||
usePlaceholders = true,
|
||||
analysis = {
|
||||
unusedParams = true,
|
||||
analyses = {
|
||||
unusedparams = true,
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
htmx = {
|
||||
filetypes = { 'html' },
|
||||
},
|
||||
ruff_lsp = {
|
||||
filetypes = { 'python' },
|
||||
},
|
||||
ruff_lsp = { filetypes = { 'python' } },
|
||||
pyright = {
|
||||
filetypes = { 'python' },
|
||||
settings = {
|
||||
|
|
@ -97,102 +54,99 @@ return {
|
|||
},
|
||||
},
|
||||
},
|
||||
rust_analyzer = {
|
||||
cmd = { 'rustup', 'run', 'stable', 'rust-analyzer' },
|
||||
rust_analyzer = { cmd = { 'rustup', 'run', 'stable', 'rust-analyzer' } },
|
||||
texlab = {
|
||||
flags = {
|
||||
debounce_text_changes = 150,
|
||||
},
|
||||
settings = {
|
||||
texlab = {
|
||||
build = {
|
||||
executable = "latexmk",
|
||||
args = { "-pdf", "-xelatex", "-output-directory=output", "-interaction=nonstopmode", "-synctex=1", "%f" },
|
||||
onSave = true,
|
||||
},
|
||||
forwardSearch = {
|
||||
executable = "zathura",
|
||||
args = { "--synctex-forward", "%l:1:%f", "%p" },
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
lua_ls = {
|
||||
filetypes = { 'lua' },
|
||||
settings = {
|
||||
Lua = {
|
||||
runtime = {
|
||||
version = 'LuaJIT',
|
||||
path = vim.split(package.path, ';'),
|
||||
},
|
||||
diagnostics = {
|
||||
globals = { 'vim' },
|
||||
},
|
||||
runtime = { version = 'LuaJIT', path = vim.split(package.path, ';') },
|
||||
diagnostics = { globals = { 'vim' } },
|
||||
workspace = {
|
||||
library = vim.api.nvim_get_runtime_file('', true),
|
||||
checkThirdParty = false,
|
||||
},
|
||||
telemetry = {
|
||||
enable = false,
|
||||
},
|
||||
telemetry = { enable = false },
|
||||
},
|
||||
},
|
||||
},
|
||||
ocamllsp = {
|
||||
manual_install = true,
|
||||
filetypes = { 'ocaml', 'ocaml.interface', 'ocaml.cram', 'ocaml.menhir' },
|
||||
settings = {
|
||||
codelens = { enabled = true },
|
||||
inlayHints = { enable = true },
|
||||
},
|
||||
},
|
||||
yamlls = {
|
||||
filetypes = { 'yaml' },
|
||||
settings = {
|
||||
yaml = {
|
||||
schemas = {
|
||||
['https://json.schemasstore.org/github-workflow.json'] = '/.github/workflows/*.{yml,yaml}',
|
||||
['https://json.schemastore.org/github-workflow.json'] = '/.github/workflows/*.{yml,yaml}',
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
taplo = {
|
||||
filetypes = { 'toml' },
|
||||
},
|
||||
dockerls = {
|
||||
filetypes = { 'Dockerfile' },
|
||||
},
|
||||
taplo = { filetypes = { 'toml' } },
|
||||
dockerls = { filetypes = { 'Dockerfile' } },
|
||||
}
|
||||
|
||||
local ensure_installed = vim.tbl_filter(function(key)
|
||||
local t = servers[key]
|
||||
if type(t) == 'table' then
|
||||
return not t.manual_install
|
||||
else
|
||||
return t
|
||||
end
|
||||
end, vim.tbl_keys(servers))
|
||||
|
||||
require('mason').setup({
|
||||
ui = {
|
||||
icons = {
|
||||
package_installed = '✓',
|
||||
package_pending = '➜',
|
||||
package_uninstalled = '✗',
|
||||
},
|
||||
-- Setup LSP servers via mason-lspconfig
|
||||
require('mason-lspconfig').setup({
|
||||
ensure_installed = vim.tbl_keys(servers),
|
||||
handlers = {
|
||||
function(server_name)
|
||||
require('lspconfig')[server_name].setup({
|
||||
capabilities = capabilities,
|
||||
})
|
||||
end,
|
||||
},
|
||||
})
|
||||
|
||||
local mason_lspconfig = require('mason-lspconfig')
|
||||
mason_lspconfig.setup({
|
||||
ensure_installed = ensure_installed,
|
||||
})
|
||||
-- Setup specific LSP servers with custom configuration
|
||||
for server, config in pairs(servers) do
|
||||
require('lspconfig')[server].setup(vim.tbl_extend('force', {
|
||||
capabilities = capabilities,
|
||||
on_attach = function(client, bufnr)
|
||||
local function nmap(keys, func, desc)
|
||||
if desc then
|
||||
desc = 'LSP: ' .. desc
|
||||
end
|
||||
vim.keymap.set('n', keys, func, { buffer = bufnr, desc = desc })
|
||||
end
|
||||
|
||||
for name, config in pairs(servers) do
|
||||
if config then
|
||||
require('lspconfig')[name].setup({
|
||||
capabilities = capabilities,
|
||||
on_attach = on_attach,
|
||||
settings = config.settings,
|
||||
filetypes = config.filetypes,
|
||||
cmd = config.cmd,
|
||||
})
|
||||
end
|
||||
end
|
||||
|
||||
require('cmp')
|
||||
|
||||
local sign = function(opts)
|
||||
vim.fn.sign_define(opts.name, {
|
||||
texthl = opts.name,
|
||||
text = opts.text,
|
||||
numhl = '',
|
||||
})
|
||||
nmap('<leader>rn', vim.lsp.buf.rename, '[R]e[n]ame')
|
||||
nmap('<leader>ca', function()
|
||||
vim.lsp.buf.code_action(require('telescope.themes').get_dropdown({
|
||||
winblend = 10,
|
||||
previewer = false,
|
||||
}))
|
||||
end, '[C]ode [A]ction')
|
||||
|
||||
nmap('gd', require('telescope.builtin').lsp_definitions, '[G]oto [D]efinition')
|
||||
nmap('gr', require('telescope.builtin').lsp_references, '[G]oto [R]eferences')
|
||||
nmap('gI', require('telescope.builtin').lsp_implementations, '[G]oto [I]mplementation')
|
||||
nmap('<leader>D', require('telescope.builtin').lsp_type_definitions, 'Type [D]efinition')
|
||||
nmap('<leader>ds', require('telescope.builtin').lsp_document_symbols, '[D]ocument [S]ymbols')
|
||||
nmap('<leader>ws', require('telescope.builtin').lsp_dynamic_workspace_symbols, '[W]orkspace [S]ymbols')
|
||||
|
||||
nmap('K', vim.lsp.buf.hover, 'Hover Documentation')
|
||||
nmap('<C-k>', vim.lsp.buf.signature_help, 'Signature Documentation')
|
||||
end,
|
||||
}, config))
|
||||
end
|
||||
|
||||
-- Diagnostics configuration
|
||||
vim.diagnostic.config({
|
||||
underline = true,
|
||||
severity_sort = true,
|
||||
|
|
@ -202,19 +156,34 @@ return {
|
|||
spacing = 2,
|
||||
},
|
||||
float = {
|
||||
source = 'if_many',
|
||||
Source = 'if_many',
|
||||
border = 'rounded',
|
||||
},
|
||||
})
|
||||
|
||||
local sign = function(opts)
|
||||
vim.fn.sign_define(opts.name, {
|
||||
texthl = opts.name,
|
||||
text = opts.text,
|
||||
numhl = '',
|
||||
})
|
||||
end
|
||||
|
||||
sign({ name = 'DiagnosticSignError', text = '✘' })
|
||||
sign({ name = 'DiagnosticSignWarn', text = '▲' })
|
||||
sign({ name = 'DiagnosticSignHint', text = '⚑' })
|
||||
sign({ name = 'DiagnosticSignInfo', text = '»' })
|
||||
|
||||
vim.lsp.handlers['textDocument/hover'] = vim.lsp.with(vim.lsp.handlers.hover, { border = 'rounded' })
|
||||
vim.lsp.handlers['textDocument/signatureHelp'] =
|
||||
vim.lsp.with(vim.lsp.handlers.signature_help, { border = 'rounded' })
|
||||
-- Fidget configuration (LSP progress)
|
||||
require('fidget').setup({})
|
||||
|
||||
-- Neodev setup for improved Lua development
|
||||
require('neodev').setup({
|
||||
library = {
|
||||
plugins = { 'nvim-dap-ui' },
|
||||
types = true,
|
||||
},
|
||||
})
|
||||
end,
|
||||
}
|
||||
|
||||
|
|
|
|||
4
lua/custom/plugins/markdown-preview.lua
Normal file
4
lua/custom/plugins/markdown-preview.lua
Normal file
|
|
@ -0,0 +1,4 @@
|
|||
return {
|
||||
'iamcco/markdown-preview.nvim',
|
||||
}
|
||||
|
||||
72
lua/custom/plugins/quarto.lua
Normal file
72
lua/custom/plugins/quarto.lua
Normal file
|
|
@ -0,0 +1,72 @@
|
|||
return {
|
||||
-- -- Quarto support for data science
|
||||
-- {
|
||||
-- 'quarto-dev/quarto-nvim',
|
||||
-- ft = { 'quarto' },
|
||||
-- opts = {
|
||||
-- codeRunner = {
|
||||
-- enabled = true,
|
||||
-- default_method = "molten",
|
||||
-- },
|
||||
-- },
|
||||
-- dependencies = {
|
||||
-- 'jmbuhr/otter.nvim', -- For language features in code cells
|
||||
-- 'nvim-treesitter/nvim-treesitter', -- Syntax highlighting and code understanding
|
||||
-- },
|
||||
-- },
|
||||
--
|
||||
-- -- Jupytext integration for working with Jupyter notebooks
|
||||
-- {
|
||||
-- 'GCBallesteros/jupytext.nvim',
|
||||
-- opts = {
|
||||
-- custom_language_formatting = {
|
||||
-- python = { extension = 'qmd', style = 'quarto', force_ft = 'quarto' },
|
||||
-- r = { extension = 'qmd', style = 'quarto', force_ft = 'quarto' },
|
||||
-- },
|
||||
-- },
|
||||
-- },
|
||||
--
|
||||
-- -- Image management and clipboard integration
|
||||
-- {
|
||||
-- 'HakonHarnes/img-clip.nvim',
|
||||
-- event = 'BufEnter',
|
||||
-- ft = { 'markdown', 'quarto', 'latex' },
|
||||
-- opts = {
|
||||
-- default = { dir_path = 'img' },
|
||||
-- filetypes = {
|
||||
-- markdown = { url_encode_path = true, template = '' },
|
||||
-- quarto = { url_encode_path = true, template = '' },
|
||||
-- },
|
||||
-- },
|
||||
-- config = function(_, opts)
|
||||
-- require('img-clip').setup(opts)
|
||||
-- vim.keymap.set('n', '<leader>ii', ':PasteImage<cr>', { desc = 'Insert image from clipboard' })
|
||||
-- end,
|
||||
-- },
|
||||
--
|
||||
-- -- Equation preview in markdown/quarto files
|
||||
-- {
|
||||
-- 'jbyuki/nabla.nvim',
|
||||
-- keys = {
|
||||
-- { '<leader>qm', ':lua require"nabla".toggle_virt()<cr>', { desc = 'Toggle math equations' } },
|
||||
-- },
|
||||
-- },
|
||||
--
|
||||
-- -- Molten for interactive code execution
|
||||
-- {
|
||||
-- 'benlubas/molten-nvim',
|
||||
-- enabled = true,
|
||||
-- build = ':UpdateRemotePlugins',
|
||||
-- init = function()
|
||||
-- vim.g.molten_image_provider = 'image.nvim'
|
||||
-- vim.g.molten_output_win_max_height = 20
|
||||
-- vim.g.molten_auto_open_output = false
|
||||
-- end,
|
||||
-- keys = {
|
||||
-- { 'n', '<leader>mi', ':MoltenInit<cr>', { desc = 'Molten init' } },
|
||||
-- { 'v', '<leader>mv', ':<C-u>MoltenEvaluateVisual<cr>', { desc = 'Evaluate visual selection' } },
|
||||
-- { 'n', '<leader>mr', ':MoltenReevaluateCell<cr>', { desc = 'Re-evaluate cell' } },
|
||||
-- },
|
||||
-- },
|
||||
}
|
||||
|
||||
|
|
@ -5,17 +5,17 @@ return {
|
|||
'nvim-treesitter/nvim-treesitter',
|
||||
},
|
||||
keys = {
|
||||
{ '<leader>ef', ":lua require('refactoring').refactor('Extract Function')<CR>", mode = 'x', desc = 'Extract Function' },
|
||||
{ '<leader>eff', ":lua require('refactoring').refactor('Extract Function To File')<CR>", mode = 'x', desc = 'Extract Function To File' },
|
||||
{ '<leader>ev', ":lua require('refactoring').refactor('Extract Variable')<CR>", mode = 'x', desc = 'Extract Variable' },
|
||||
{ '<leader>eI', ":lua require('refactoring').refactor('Inline Function')<CR>", mode = 'n', desc = 'Inline Function' },
|
||||
{ '<leader>ei', ":lua require('refactoring').refactor('Inline Variable')<CR>", mode = { 'n', 'x' }, desc = 'Inline Variable' },
|
||||
{ '<leader>eb', ":lua require('refactoring').refactor('Extract Block')<CR>", mode = 'n', desc = 'Extract Block' },
|
||||
{ '<leader>ebf', ":lua require('refactoring').refactor('Extract Block To File')<CR>", mode = 'n', desc = 'Extract Block To File' },
|
||||
{ '<leader>ef', ":lua require('refactoring').refactor('Extract Function')<CR>", mode = 'x', desc = 'Extract Function' },
|
||||
{ '<leader>eff', ":lua require('refactoring').refactor('Extract Function To File')<CR>", mode = 'x', desc = 'Extract Function To File' },
|
||||
{ '<leader>ev', ":lua require('refactoring').refactor('Extract Variable')<CR>", mode = 'x', desc = 'Extract Variable' },
|
||||
{ '<leader>eI', ":lua require('refactoring').refactor('Inline Function')<CR>", mode = 'n', desc = 'Inline Function' },
|
||||
{ '<leader>ei', ":lua require('refactoring').refactor('Inline Variable')<CR>", mode = { 'n', 'x' }, desc = 'Inline Variable' },
|
||||
{ '<leader>eb', ":lua require('refactoring').refactor('Extract Block')<CR>", mode = 'n', desc = 'Extract Block' },
|
||||
{ '<leader>ebf', ":lua require('refactoring').refactor('Extract Block To File')<CR>", mode = 'n', desc = 'Extract Block To File' },
|
||||
},
|
||||
config = function()
|
||||
require('refactoring').setup({
|
||||
show_success_message = false,
|
||||
show_success_message = true,
|
||||
})
|
||||
end,
|
||||
}
|
||||
|
|
|
|||
|
|
@ -4,7 +4,6 @@ return {
|
|||
dependencies = {
|
||||
'nvim-treesitter/nvim-treesitter-textobjects',
|
||||
'https://github.com/apple/pkl-neovim.git',
|
||||
'windwp/nvim-ts-autotag',
|
||||
},
|
||||
build = ':TSUpdate',
|
||||
config = function()
|
||||
|
|
@ -12,7 +11,8 @@ return {
|
|||
local ts = require('nvim-treesitter.configs')
|
||||
ts.setup({
|
||||
ensure_installed = {
|
||||
'c', 'cpp', 'lua', 'python', 'go', 'rust', 'vimdoc', 'vim'
|
||||
'bash', 'c', 'cpp', 'lua', 'python', 'go', 'markdown', 'markdown_inline', 'r', 'rust', 'vimdoc', 'vim', 'yaml',
|
||||
'query'
|
||||
},
|
||||
ignore_install = { '' },
|
||||
highlight = {
|
||||
|
|
@ -23,10 +23,10 @@ return {
|
|||
incremental_selection = {
|
||||
enable = true,
|
||||
keymaps = {
|
||||
init_selection = '<c-space>',
|
||||
node_incremental = '<c-space>',
|
||||
scope_incremental = '<c-s>',
|
||||
node_decremental = '<M-space>',
|
||||
init_selection = 'gnn',
|
||||
node_incremental = 'grn',
|
||||
scope_incremental = 'grc',
|
||||
node_decremental = 'grm',
|
||||
},
|
||||
},
|
||||
textobjects = {
|
||||
|
|
@ -73,16 +73,6 @@ return {
|
|||
},
|
||||
},
|
||||
})
|
||||
|
||||
-- Autotag setup
|
||||
require('nvim-ts-autotag').setup({
|
||||
enable = true,
|
||||
})
|
||||
end,
|
||||
opts = {
|
||||
autotag = {
|
||||
enable = true,
|
||||
},
|
||||
},
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -2,11 +2,11 @@ return {
|
|||
'folke/trouble.nvim',
|
||||
cmd = "Trouble",
|
||||
opts = {
|
||||
auto_open = false,
|
||||
auto_close = true,
|
||||
auto_preview = true,
|
||||
auto_fold = true,
|
||||
use_diagnostic_signs = true,
|
||||
auto_open = false,
|
||||
auto_close = true,
|
||||
auto_preview = true,
|
||||
auto_fold = true,
|
||||
use_diagnostic_signs = true,
|
||||
},
|
||||
keys = {
|
||||
{ "<leader>tt", "<cmd>Trouble diagnostics toggle<cr>", desc = "Diagnostics (Trouble)" },
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue