Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .config/nvim/lua/config/autocmds.lua
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,10 @@ vim.api.nvim_create_autocmd("FileType", {
end,
{ desc = "Toggle render-markdown on an RMarkdown file" }
)
vim.keymap.set({
"n",
"i",
}, "<leader>`", "<Esc>i```{r}<CR>```<Esc>O", { desc = "New fenced RMarkdown code block" })
end,
})

Expand Down
1 change: 0 additions & 1 deletion .config/nvim/lua/config/keymaps.lua
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ vim.keymap.set("t", "<Esc>", "<C-\\><C-n>") -- Fix <Esc> in terminal buffer
vim.keymap.set("n", "<Leader>H", ":set hlsearch!<CR>", { desc = "Toggle search highlight" })
vim.keymap.set("n", "<leader>W", ":%s/\\s\\+$//<cr>:let @/=''<CR>", { desc = "Clean trailing whitespace" })
vim.keymap.set({ "n", "i" }, "<leader>R", "<Esc>:syntax sync fromstart<CR>", { desc = "Refresh syntax highlighting" })
vim.keymap.set({ "n", "i" }, "<leader>`", "<Esc>i```{r}<CR>```<Esc>O", { desc = "New fenced RMarkdown code block" })
vim.keymap.set(
{ "n", "i" },
"<leader>ts",
Expand Down
6 changes: 3 additions & 3 deletions .config/nvim/lua/config/options.lua
Original file line number Diff line number Diff line change
Expand Up @@ -38,11 +38,11 @@ vim.opt.wildmenu = true -- Make tab completion for files/buffers act like bash
vim.opt.wildmode="list:full" -- Show a list when pressing tab; complete first full match
vim.opt.wildignore:append("*.swp,*.bak,*.pyc,*.class") -- Ignore these when autocompleting
vim.opt.cursorline = true -- Highlight line where the cursor is
vim.opt.fillchars:append { diff = "" } -- in diffs, show deleted lines with slashes rather than dashes
vim.opt.fillchars:append { diff = "·" } -- in diffs, show deleted lines with dots rather than dashes
vim.opt.signcolumn = "yes" -- always show the signcolumn to minimize distraction of appearing and disappearing

-- vim.cmd(":autocmd InsertEnter * set cul") -- Color the current line in upon entering insert mode
-- vim.cmd(":autocmd InsertLeave * set nocul") -- Remove color upon existing insert mode
-- vim.cmd(":autocmd InsertEnter * set nocul") -- Remove color when entering insert mode
-- vim.cmd(":autocmd InsertLeave * set cul") -- Turn color back on when exiting insert mode
-- vim.cmd("set guicursor=i:block") -- Always use block cursor. In some terminals and fonts (like iTerm), it can be hard to see the cursor when it changes to a line.

-- Copy all yanked/deleted lines to the "+" buffer. Useful when you want to use
Expand Down
1 change: 0 additions & 1 deletion .config/nvim/lua/plugins/beacon.lua
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ return {

end,
keys = {
{ "<S-k><S-j>", ":Beacon<CR>", desc = "Flash beacon" },
{ "N", "N:Beacon<CR>", desc = "Prev search hit and flash beacon" },
{ "n", "n:Beacon<CR>", desc = "Next search hit and flash beacon" },
{ "%", "%:Beacon<CR>", desc = "Go to matching bracket and flash beacon" },
Expand Down
76 changes: 76 additions & 0 deletions .config/nvim/lua/plugins/blink.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
-- blink.cmp provides autocompletion

-- Used below to detect if we're in a word or not
local has_words_before = function()
local col = vim.api.nvim_win_get_cursor(0)[2]
if col == 0 then
return false
end
local line = vim.api.nvim_get_current_line()
return line:sub(col, col):match("%s") == nil
end
return {
"saghen/blink.cmp",
dependencies = {
"rafamadriz/friendly-snippets",
'Kaiser-Yang/blink-cmp-dictionary',
dependencies = { 'nvim-lua/plenary.nvim' }
},

-- using a release tag downloads pre-built binaries
version = "v1.*",

opts = {
keymap = {
-- At any time, <C-Space> to show menu, arrows to select, Enter to accept.
preset = 'default',

-- Additionally, this configures tab-completion to mimic what happens in bash:
-- * Tab shows selections if cursor is in or immediately after a word, and immediately fills in the first item
-- * Enter to select.
-- * Tab scrolls thru suggestions (or Shift-Tab to go back)
--
['<Tab>'] = {
function(cmp)
if has_words_before() then
return cmp.show_and_insert()
end
end,
'snippet_forward',
'select_next',
'fallback',
},
-- Navigate to the previous suggestion or cancel completion if currently on the first one.
['<S-Tab>'] = { 'snippet_backward', 'insert_prev' },
['<CR>'] = { 'accept', 'fallback' },
},
sources = {
default = function()
local result = { 'lsp', 'path', 'snippets', 'buffer' }

-- turn on dictionary completion in non-code files
if vim.tbl_contains({ 'markdown', 'text', 'rst' }, vim.bo.filetype) then
table.insert(result, 'dictionary')
end
return result
end,
providers = {
dictionary = {
module = 'blink-cmp-dictionary',
name = 'Dict',
min_keyword_length = 3,
opts = {
-- This is the location of the word list on macOS and many Linux distributions
dictionary_files = { '/usr/share/dict/words' }
}
}
},
},
fuzzy = { implementation = "prefer_rust_with_warning" },
completion = {
menu = { auto_show = false },
trigger = { show_in_snippet = false },
},
},
opts_extend = { "sources.default" },
}
1 change: 1 addition & 0 deletions .config/nvim/lua/plugins/browsher.lua
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
-- browsher will copy a link to github/gitlab based on where you are in the code
return {
'claydugo/browsher.nvim',
event = "VeryLazy",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,4 +24,5 @@ return {
lazy = false,
priority = 1000,
},
{ "daler/zenfade", dependencies = { "rktjmp/lush.nvim" }, lazy = false, priority = 1000 },
}
5 changes: 2 additions & 3 deletions .config/nvim/lua/plugins/conform.lua
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,8 @@ return {
formatters_by_ft = {
lua = { "stylua" },
python = { "isort", "black" },
javascript = { { "prettierd", "prettier" } },
bash = { { "shfmt" } },
sh = { { "shfmt" } },
bash = { "shfmt" },
sh = { "shfmt" },
},
formatters = {
shfmt = {
Expand Down
4 changes: 4 additions & 0 deletions .config/nvim/lua/plugins/indent-o-matic.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
-- indent-o-matic provides automatic detection of indentation settings
return {
'Darazaki/indent-o-matic'
}
6 changes: 6 additions & 0 deletions .config/nvim/lua/plugins/lush.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
-- lush is used for colormaps and designing/modifying colormaps
return {
priority=1000,
lazy=false,
"rktjmp/lush.nvim",
}
11 changes: 0 additions & 11 deletions .config/nvim/lua/plugins/nightfox.lua

This file was deleted.

70 changes: 0 additions & 70 deletions .config/nvim/lua/plugins/nvim-cmp.lua

This file was deleted.

3 changes: 3 additions & 0 deletions .config/nvim/lua/plugins/render-markdown.lua
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,9 @@ return {
internal = { pattern = ".*", icon = "⛬ ", highlight = "RenderMarkdownLink" },
},
},
checkbox = {
checked = { icon = "✓" }
}
},
},
}
12 changes: 12 additions & 0 deletions .config/nvim/lua/plugins/treesj.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
-- treesj splits and joins nodes
return {
'Wansmer/treesj',
lazy = false,
dependencies = { 'nvim-treesitter/nvim-treesitter' },
config = function()
require('treesj').setup({
use_default_keymaps = false,
})
vim.keymap.set('n', '<leader>j', require('treesj').toggle, { desc = "Toggle split/join nodes" })
end,
}
4 changes: 0 additions & 4 deletions .config/nvim/lua/plugins/vim-sleuth.lua

This file was deleted.

4 changes: 2 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -96,13 +96,13 @@ RUN ./setup.sh --install-npm
# Additional for this container: asciinema for screen casts
RUN source ~/.bashrc \
&& ca \
&& mamba create -y -n asciinema asciinema \
&& conda create -y -n asciinema asciinema \
&& ln -s $(conda info --base)/envs/asciinema/bin/asciinema ~/opt/bin

# imagemagick for converting gifs
RUN source ~/.bashrc \
&& ca \
&& mamba create -y -n imagemagick imagemagick \
&& conda create -y -n imagemagick imagemagick \
&& ln -s $(conda info --base)/envs/imagemagick/bin/convert ~/opt/bin

# Install fonts for use by agg
Expand Down
50 changes: 50 additions & 0 deletions docs/_static/plugin_metadata.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
/* Styling for plugin metadata */
.plugin-metadata {
background-color: #f5f5f5;
border-left: 3px solid #ccc;
padding: 10px;
margin-bottom: 15px;
font-size: 0.9em;
}

/* Style for commit hashes */
.plugin-metadata code, .plugin-metadata tt {
background-color: #f0f0f0;
border: 1px solid #ddd;
padding: 0 3px;
font-size: 0.9em;
border-radius: 3px;
color: #666;
font-weight: bold;
}

/* Style for commit messages */
.plugin-metadata em {
font-style: italic;
color: #444;
}

/* Style for the changes list */
.plugin-metadata ul {
margin-left: 20px;
padding-left: 0;
}

.plugin-metadata li {
margin-bottom: 4px;
}

/* Style for definition lists */
.plugin-metadata dl {
margin-bottom: 10px;
}

.plugin-metadata dt {
font-weight: bold;
color: #666;
}

.plugin-metadata dd {
margin-left: 20px;
margin-bottom: 5px;
}
42 changes: 40 additions & 2 deletions docs/changelog.rst
Original file line number Diff line number Diff line change
@@ -1,6 +1,44 @@
Changelog
=========

2025-08-14
----------

**vim**

- Replace vim-sleuth with indent-o-matic for better indentation detection
- Replace nvim-cmp with blink.cmp for autocompletion (about the same features but with simplified config)
- Update checkbox rendering in markdown files
- Add zenfade colorscheme (not enabled by default)
- Nicer diff deletion symbol
- Add lush plugin
- Add treesj plugin
- Bump installed nvim version to 0.10.4

**setup**

- conda installation dir can be configured via env var ``CONDA_INSTALLATION_DIR``
- dockerfile uses conda rather than mamba for testing

**docs**

Nvim documentation overhaul. This now includes a new sphinx extension which
inspects the git history to create a changelog of a plugin. This looks for the
plugin name in filenames, commit messages, and changed text in an attempt to be
more transparent about changes over time.

The updates also include splitting the vim plugins from the main vim docs and
rewriting some supporting docs for vim.

2025-05-16
----------

**setup**

``--dotfiles`` now properly handles backups of existing files, using a manual
copy approach rather than rsync (thanks @mitraak)


2025-05-07
----------

Expand All @@ -15,8 +53,8 @@ Changelog

- The previous changes (2024-11-19) for better Python code pasting did not work
on all systems. IPython would sometimes have a lag using ``%cpaste``. So this
time, we use `bracketed paste <https://en.wikipedia.org/wiki/Bracketed-paste>
`__ when pasting into a running terminal. This seems to have better behavior
time, we use `bracketed paste <https://en.wikipedia.org/wiki/Bracketed-paste>`__
when pasting into a running terminal. This seems to have better behavior
in general (including R) by reducing the noise of pasted lines.

- new plugin, `browsher`, to construct a URL for github/gitlab that highlights
Expand Down
3 changes: 2 additions & 1 deletion docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,8 @@
sys.path.insert(0, ".")
extensions = [
"sphinx.ext.autosectionlabel",
"details_ext"
"details_ext",
"plugin_metadata_ext"
]

# Add any paths that contain templates here, relative to this directory.
Expand Down
Loading