relative line numbers, opencode plugin
This commit is contained in:
@@ -110,7 +110,7 @@ do
|
|||||||
vim.o.number = true
|
vim.o.number = true
|
||||||
-- You can also add relative line numbers, to help with jumping.
|
-- You can also add relative line numbers, to help with jumping.
|
||||||
-- Experiment for yourself to see if you like it!
|
-- Experiment for yourself to see if you like it!
|
||||||
-- vim.o.relativenumber = true
|
vim.o.relativenumber = true
|
||||||
|
|
||||||
-- Enable mouse mode, can be useful for resizing splits for example!
|
-- Enable mouse mode, can be useful for resizing splits for example!
|
||||||
vim.o.mouse = 'a'
|
vim.o.mouse = 'a'
|
||||||
@@ -527,7 +527,9 @@ do
|
|||||||
layout_config = {
|
layout_config = {
|
||||||
height = 0.95,
|
height = 0.95,
|
||||||
width = 0.95,
|
width = 0.95,
|
||||||
preview_height = 0.5,
|
vertical = {
|
||||||
|
preview_height = 0.5,
|
||||||
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
-- pickers = {}
|
-- pickers = {}
|
||||||
@@ -1007,7 +1009,7 @@ do
|
|||||||
-- NOTE: You can add your own plugins, configuration, etc from `lua/custom/plugins/*.lua`
|
-- NOTE: You can add your own plugins, configuration, etc from `lua/custom/plugins/*.lua`
|
||||||
--
|
--
|
||||||
-- Uncomment the following line and add your plugins to `lua/custom/plugins/*.lua` to get going.
|
-- Uncomment the following line and add your plugins to `lua/custom/plugins/*.lua` to get going.
|
||||||
-- require 'custom.plugins'
|
require 'custom.plugins'
|
||||||
end
|
end
|
||||||
|
|
||||||
-- The line beneath this is called `modeline`. See `:help modeline`
|
-- The line beneath this is called `modeline`. See `:help modeline`
|
||||||
|
|||||||
@@ -0,0 +1,43 @@
|
|||||||
|
vim.pack.add {
|
||||||
|
{
|
||||||
|
src = 'https://github.com/nickjvandyke/opencode.nvim',
|
||||||
|
version = vim.version.range '*',
|
||||||
|
},
|
||||||
|
}
|
||||||
|
|
||||||
|
local opencode_port = 4096
|
||||||
|
local opencode_url = 'http://127.0.0.1:' .. opencode_port
|
||||||
|
|
||||||
|
---@type opencode.Opts
|
||||||
|
vim.g.opencode_opts = {
|
||||||
|
server = {
|
||||||
|
url = opencode_url,
|
||||||
|
start = false,
|
||||||
|
},
|
||||||
|
}
|
||||||
|
|
||||||
|
vim.o.autoread = true -- Required for `vim.g.opencode_opts.events.reload`.
|
||||||
|
|
||||||
|
vim.keymap.set({ 'n', 'x' }, '<leader>oa', function()
|
||||||
|
require('opencode').ask('@this: ')
|
||||||
|
end, { desc = 'Ask opencode' })
|
||||||
|
|
||||||
|
vim.keymap.set({ 'n', 'x' }, '<leader>os', function()
|
||||||
|
require('opencode').select()
|
||||||
|
end, { desc = 'Select opencode action' })
|
||||||
|
|
||||||
|
vim.keymap.set({ 'n', 'x' }, 'go', function()
|
||||||
|
return require('opencode').operator('@this ')
|
||||||
|
end, { desc = 'Add range to opencode', expr = true })
|
||||||
|
|
||||||
|
vim.keymap.set('n', 'goo', function()
|
||||||
|
return require('opencode').operator('@this ') .. '_'
|
||||||
|
end, { desc = 'Add line to opencode', expr = true })
|
||||||
|
|
||||||
|
vim.keymap.set('n', '<S-C-u>', function()
|
||||||
|
require('opencode').command('session.half.page.up')
|
||||||
|
end, { desc = 'Scroll opencode up' })
|
||||||
|
|
||||||
|
vim.keymap.set('n', '<S-C-d>', function()
|
||||||
|
require('opencode').command('session.half.page.down')
|
||||||
|
end, { desc = 'Scroll opencode down' })
|
||||||
Reference in New Issue
Block a user