Compare commits

...

6 Commits

6 changed files with 91 additions and 0 deletions

View File

@@ -0,0 +1,7 @@
return {
settings = {
initializationOptions = {
telemetry = "off",
},
},
}

View File

@@ -32,6 +32,20 @@ vim.o.expandtab = true
vim.o.ignorecase = true
vim.o.smartcase = true
-- osc52 escape codes copy
vim.g.clipboard = {
name = "osc52-writeonly",
copy = {
["+"] = require("vim.ui.clipboard.osc52").copy("+"),
},
paste = {
["+"] = function()
vim.notify("can't paste via osc52", vim.log.levels.WARN)
return {}
end,
},
}
vim.o.completeopt = "menuone,noselect,fuzzy,nosort"
-- default plus added dash

22
lua/plugins/copilot.lua Normal file
View File

@@ -0,0 +1,22 @@
local now_if_args = vim.fn.argc(-1) > 0 and MiniDeps.now or MiniDeps.later
now_if_args(function()
MiniDeps.add("github/copilot.vim")
vim.g.copilot_filetypes = {
-- disable all and only allow specific filetyps
["*"] = false,
--
c = true,
cpp = true,
dockerfile = true,
go = true,
javascript = true,
lua = true,
nix = true,
python = true,
rust = true,
sh = true,
typescript = true,
}
end)

View File

@@ -10,6 +10,9 @@ MiniDeps.later(function()
"ruff",
"stylua",
"lua_ls",
"nixd",
"nil_ls",
"docker_language_server",
})
vim.api.nvim_create_autocmd("LspAttach", {

View File

@@ -1,4 +1,5 @@
return {
["copilot.vim"] = "da369d90cfd6c396b1d0ec259836a1c7222fb2ea",
["fzf-lua"] = "c0c0926eee09f2e7868e5b72cb66decc0cb13aca",
["git-blame.nvim"] = "9874ec1ec8bc53beb33b7cd82c092b85271a578b",
["gitlinker.nvim"] = "cc59f732f3d043b626c8702cb725c82e54d35c25",

44
plugin/geterm.lua Normal file
View File

@@ -0,0 +1,44 @@
---@class TermBuf
---@field buf_id integer
---@field term_id integer
---@type table<number, TermBuf>
local state = {}
---@param n integer
local function get_from_state(n)
local term_buf = state[n]
if term_buf ~= nil and vim.api.nvim_buf_is_valid(term_buf.buf_id) then
return term_buf
end
state[n] = nil
return nil
end
---@param n integer
local function get_or_create_term(n)
if get_from_state(n) ~= nil then
vim.api.nvim_win_set_buf(0, state[n].buf_id)
return
end
vim.cmd.terminal()
local buf_id = vim.api.nvim_get_current_buf()
local term_id = vim.b.terminal_job_id
vim.cmd.startinsert()
state[n] = { buf_id = buf_id, term_id = term_id }
end
---@param f function
local function count_fn(f)
local function wrap(...)
local count = vim.v.count
return f(count, arg)
end
return wrap
end
vim.keymap.set("n", "<leader>tn", count_fn(get_or_create_term))