Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
jmbuhr committed Feb 28, 2025
1 parent fd50ef2 commit 861cac2
Show file tree
Hide file tree
Showing 9 changed files with 47 additions and 65 deletions.
5 changes: 3 additions & 2 deletions init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
require 'config.global'
require 'config.lazy'
require 'config.autocommands'
-- require 'config.redir'
require 'config.redir'

vim.cmd.colorscheme 'kanagawa'
vim.cmd.colorscheme 'rusty'
vim.api.nvim_set_hl(0, 'TermCursor', { fg = '#A6E3A1', bg = '#A6E3A1' })
33 changes: 1 addition & 32 deletions lua/config/redir.lua
Original file line number Diff line number Diff line change
Expand Up @@ -140,39 +140,8 @@ vim.api.nvim_create_user_command("Redir", redir, {
range = true,
bang = true,
})
vim.cmd([[cabbrev R Redir]])

vim.api.nvim_create_user_command("Mes", function()
vim.api.nvim_create_user_command("Messsages", function()
vim.cmd("Redir messages")
end, { bar = true })
vim.cmd([[cabbrev M Mes]])

local function evaler(range)
return function(bang)
local line = vim.fn.getline(1)
local it = string.match(line, "^#!(.*)")

local cmd = string.format("%sRedir%s !", range, bang and "!" or "")

if it and it ~= "" then
vim.cmd(cmd .. it)
else
vim.fn.feedkeys(":" .. cmd, "tn")
end
end
end

vim.api.nvim_create_user_command("EvalFile", function(args)
local bang = args.bang
evaler("%")(bang)
end, { bar = true, bang = true })

vim.api.nvim_create_user_command("EvalLine", function(args)
local bang = args.bang
evaler(".")(bang)
end, { bar = true, bang = true })

vim.api.nvim_create_user_command("EvalRange", function(args)
local bang = args.bang
evaler("'<,'>")(bang)
end, { bar = true, bang = true, range = true })
4 changes: 3 additions & 1 deletion lua/kickstart/health.lua
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@ local check_image_dependencies = function()
end
local v = vim.version.parse(kitty_version)
local minimal = vim.version.parse '0.30.1'
assert(minimal, 'failed to parse version')
if v and vim.version.cmp(v, minimal) < 0 then
vim.health.warn 'kitty version is too old'
return
Expand Down Expand Up @@ -107,14 +108,15 @@ local check_image_dependencies = function()
local version = out:gsub('tmux (%d+%.%d+)([a-z])', '%1.' .. number)
local v = vim.version.parse(version)
local minimal = vim.version.parse '3.3.1'
assert(minimal, 'failed to parse version')
if v and vim.version.cmp(v, minimal) < 0 then
vim.health.warn 'tmux version is too old'
return
end
end

-- check if magick luarock is available
local ok, magick = pcall(require, 'magick')
local ok, _ = pcall(require, 'magick')
if not ok then
vim.health.warn 'magick luarock is not available'
return
Expand Down
11 changes: 11 additions & 0 deletions lua/plugins/colorthemes.lua
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,17 @@ return {
priority = 1000, -- make sure to load this before all the other start plugins
},

{
"armannikoyan/rusty",
lazy = false,
priority = 1000,
opts = {
transparent = true,
italic_comments = true,
underline_current_line = true,
},
},

{
'oxfist/night-owl.nvim',
enabled = false,
Expand Down
10 changes: 4 additions & 6 deletions lua/plugins/common.lua
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,10 @@ return {
lazy = false,
opts = {
styles = {},
bigfile = { enabled = true, notify = false },
notifier = { enabled = false },
quickfile = { enabled = true },
statuscolumn = { enabled = false },
words = { enabled = false },
picker = {}
bigfile = { notify = false },
quickfile = {},
picker = {},
indent = {}
},
},
}
9 changes: 5 additions & 4 deletions lua/plugins/completion.lua
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ return {
},
{
'jmbuhr/cmp-pandoc-references',
dev = false,
dev = true,
ft = { 'quarto', 'markdown', 'rmarkdown' },
},
{ 'kdheepak/cmp-latex-symbols' },
Expand All @@ -39,13 +39,13 @@ return {
['<c-y>'] = { 'show_documentation', 'hide_documentation' },
},
sources = {
default = { "lazydev", "lsp", "path", "git", "snippets", "buffer", "emoji" },
default = { "lazydev", "lsp", "path", "references", "git", "snippets", "buffer", "emoji" },
cmdline = {},
providers = {
emoji = {
module = "blink-emoji",
name = "Emoji",
score_offset = 15, -- Tune by preference
score_offset = -1,
},
lazydev = {
name = "LazyDev",
Expand All @@ -63,7 +63,8 @@ return {
},
references = {
name = "pandoc_references",
module = "blink.compat.source",
module = "cmp-pandoc-references.blink",
score_offset = 2,
},
symbols = { name = "symbols", module = "blink.compat.source" },
},
Expand Down
2 changes: 2 additions & 0 deletions lua/plugins/editing.lua
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,8 @@ return {
lua = { 'mystylua' },
python = { 'isort', 'black' },
quarto = { 'injected' },
markdown = { 'injected' },
r = { 'styler' },
},
formatters = {
mystylua = {
Expand Down
29 changes: 18 additions & 11 deletions lua/plugins/lsp.lua
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,14 @@ return {

{ -- for lsp features in code cells / embedded code
'jmbuhr/otter.nvim',
dev = true,
dev = false,
dependencies = {
{
'neovim/nvim-lspconfig',
'nvim-treesitter/nvim-treesitter',
},
},
opts = {
buffers = {
set_filetype = true,
write_to_disk = false
}
}
opts = {}
},

{
Expand Down Expand Up @@ -93,11 +88,23 @@ return {
map('gI', vim.lsp.buf.implementation, '[g]o to [I]mplementation')
map('gr', vim.lsp.buf.references, '[g]o to [r]eferences')
map(']d',
function() if vim.fn.has("nvim-0.11.0") == 1 then vim.diagnostic.jump({ count = 1 }) else vim.diagnostic
.goto_next() end end, 'next [d]iagnostic ')
function()
if vim.fn.has("nvim-0.11.0") == 1 then
vim.diagnostic.jump({ count = 1 })
else
vim.diagnostic
.goto_next()
end
end, 'next [d]iagnostic ')
map('[d',
function() if vim.fn.has("nvim-1.11.0") == 1 then vim.diagnostic.jump({ count = -1 }) else vim.diagnostic
.goto_prev() end end, 'previous [d]iagnostic ')
function()
if vim.fn.has("nvim-1.11.0") == 1 then
vim.diagnostic.jump({ count = -1 })
else
vim.diagnostic
.goto_prev()
end
end, 'previous [d]iagnostic ')
map('<leader>ll', vim.lsp.codelens.run, '[l]ens run')
map('<leader>lR', vim.lsp.buf.rename, '[l]sp [R]ename')
map('<leader>lf', vim.lsp.buf.format, '[l]sp [f]ormat')
Expand Down
9 changes: 0 additions & 9 deletions lua/plugins/ui.lua
Original file line number Diff line number Diff line change
Expand Up @@ -373,15 +373,6 @@ return {
end,
},

{ -- show indent lines
'lukas-reineke/indent-blankline.nvim',
enabled = false,
main = 'ibl',
opts = {
indent = { char = '' },
},
},

{ -- highlight markdown headings and code blocks etc.
'lukas-reineke/headlines.nvim',
enabled = false,
Expand Down

0 comments on commit 861cac2

Please sign in to comment.