Compare commits

...

3 commits

Author SHA1 Message Date
Casper V. Kristensen be70a4385a vim: telescope-undo 2024-08-25 15:40:07 +02:00
Casper V. Kristensen 7d50f0324e vim: fix colorscheme 2024-08-25 15:38:42 +02:00
Casper V. Kristensen 2655411b56 vim: use double quotes 2024-08-25 15:38:01 +02:00

View file

@ -131,20 +131,20 @@
-- Restore cursor position when opening a file
-- https://github.com/neovim/neovim/issues/16339#issuecomment-1457394370
vim.api.nvim_create_autocmd('BufRead', {
vim.api.nvim_create_autocmd("BufRead", {
callback = function(opts)
vim.api.nvim_create_autocmd('BufWinEnter', {
vim.api.nvim_create_autocmd("BufWinEnter", {
once = true,
buffer = opts.buf,
callback = function()
local ft = vim.bo[opts.buf].filetype
local last_known_line = vim.api.nvim_buf_get_mark(opts.buf, '"')[1]
if
not (ft:match('commit') and ft:match('rebase'))
not (ft:match("commit") and ft:match("rebase"))
and last_known_line > 1
and last_known_line <= vim.api.nvim_buf_line_count(opts.buf)
then
vim.api.nvim_feedkeys([[g`"]], 'nx', false)
vim.api.nvim_feedkeys([[g`"]], "nx", false)
end
end,
})
@ -164,11 +164,20 @@
*/
''
require("kanagawa").setup({
theme = "wave",
commentStyle = { italic = false },
keywordStyle = { italic = false },
statementStyle = { bold = false },
dimInactive = true,
colors = {
theme = {
wave = {
syn = {
-- Make control flow keywords more pronounced.
-- statement = colors.theme.syn.special2,
keyword = "#E46876" -- waveRed; same as syn.special2
},
},
all = {
ui = {
-- Don't use a special background for the gutter
@ -177,9 +186,15 @@
},
},
},
-- https://github.com/rebelot/kanagawa.nvim/blob/master/lua/kanagawa/themes.lua
-- https://github.com/rebelot/kanagawa.nvim/blob/master/lua/kanagawa/highlights/syntax.lua
-- See `:h highlight-groups` and `:h group-name`.
overrides = function(colors)
local theme = colors.theme
return {
-- Show booleans like other special symbols such as 'None'
-- in Python.
Boolean = { fg = theme.syn.special1, bold = false },
-- Transparent Floating Windows
NormalFloat = { bg = "none" },
FloatBorder = { bg = "none" },
@ -194,7 +209,7 @@
}
end,
})
vim.cmd("colorscheme kanagawa")
vim.cmd.colorscheme("kanagawa")
'';
}
@ -493,6 +508,16 @@
},
},
},
extensions = {
-- Use vertical layout to allow enough width for
-- side-by-side diffs.
undo = {
layout_strategy = "vertical",
layout_config = {
preview_height = 0.8,
},
},
},
})
-- Keymaps mostly inspired by the popular distros.
@ -544,6 +569,22 @@
require("telescope").load_extension("ui-select")
'';
}
# Visualize your undo tree and fuzzy-search changes in it. For those
# days where committing early and often doesn't work out.
# https://github.com/debugloop/telescope-undo.nvim
{
plugin = telescope-undo-nvim;
type = "lua";
config =
/*
lua
*/
''
local telescope = require("telescope")
telescope.load_extension("undo")
vim.keymap.set("n", "<Leader>fu", telescope.extensions.undo.undo)
'';
}
# Buffer list that lives in the tabline.
# https://github.com/akinsho/bufferline.nvim