remove nvim-tree, clean useless autocmds
This commit is contained in:
+3
-91
@@ -1,95 +1,7 @@
|
||||
local autocmd = vim.api.nvim_create_autocmd
|
||||
|
||||
autocmd({'BufEnter', 'QuitPre'}, {
|
||||
nested = false,
|
||||
callback = function(e)
|
||||
local tree = require('nvim-tree.api').tree
|
||||
|
||||
-- Nothing to do if tree is not opened
|
||||
if not tree.is_visible() then
|
||||
return
|
||||
end
|
||||
|
||||
local winCount = 0
|
||||
for _,winId in ipairs(vim.api.nvim_list_wins()) do
|
||||
if vim.api.nvim_win_get_config(winId).focusable then
|
||||
winCount = winCount + 1
|
||||
end
|
||||
end
|
||||
|
||||
-- We want to quit and only one window besides tree is left
|
||||
if e.event == 'QuitPre' and winCount == 2 then
|
||||
vim.api.nvim_cmd({cmd = 'qall'}, {})
|
||||
end
|
||||
|
||||
-- :bd was probably issued an only tree window is left
|
||||
-- Behave as if tree was closed (see `:h :bd`)
|
||||
if e.event == 'BufEnter' and winCount == 1 then
|
||||
-- Required to avoid "Vim:E444: Cannot close last window"
|
||||
vim.defer_fn(function()
|
||||
-- close nvim-tree: will go to the last buffer used before closing
|
||||
tree.toggle({find_file = true, focus = true})
|
||||
-- re-open nivm-tree
|
||||
tree.toggle({find_file = true, focus = false})
|
||||
end, 10)
|
||||
end
|
||||
end
|
||||
})
|
||||
|
||||
autocmd("BufEnter", {
|
||||
pattern = "copilot-*",
|
||||
callback = function()
|
||||
vim.opt.foldmethod = "expr"
|
||||
vim.opt.foldexpr = "v:lua.require('config.testfold').foldexpr()"
|
||||
vim.opt.foldenable = true
|
||||
vim.opt.foldlevel = 0
|
||||
vim.opt.foldlevelstart = 0
|
||||
autocmd("LspAttach", {
|
||||
callback = function(args)
|
||||
vim.lsp.document_color.enable(false, args.buf, { "background" })
|
||||
end,
|
||||
})
|
||||
|
||||
autocmd("VimEnter", {
|
||||
callback = function()
|
||||
--NVIM_ENTER=1
|
||||
vim.cmd([[call chansend(v:stderr, "\033]1337;SetUserVar=NVIM_ENTER=MQ==\007")]])
|
||||
end,
|
||||
})
|
||||
|
||||
autocmd("VimLeavePre", {
|
||||
callback = function()
|
||||
--NVIM_ENTER=0
|
||||
vim.cmd([[call chansend(v:stderr, "\033]1337;SetUserVar=NVIM_ENTER=MA==\007")]])
|
||||
end,
|
||||
})
|
||||
|
||||
vim.api.nvim_create_autocmd("VimLeave", {
|
||||
pattern = "*",
|
||||
command = "set guicursor=a:ver25"
|
||||
})
|
||||
|
||||
autocmd({"BufEnter", "BufRead", "BufNewFile" }, {
|
||||
pattern = "*",
|
||||
callback = function()
|
||||
vim.bo.tabstop = 4
|
||||
vim.bo.shiftwidth = 4
|
||||
vim.bo.softtabstop = 4
|
||||
vim.bo.expandtab = true
|
||||
vim.bo.smartindent = true
|
||||
end,
|
||||
})
|
||||
|
||||
autocmd("BufWritePre", {
|
||||
pattern = {"*.zig", "*.zon"},
|
||||
callback = function(ev)
|
||||
vim.lsp.buf.code_action({
|
||||
context = { only = { "source.organiceImports" }},
|
||||
apply = true,
|
||||
})
|
||||
end,
|
||||
})
|
||||
|
||||
-- autocmd("FileWrite", {
|
||||
-- pattern = { "~/.config/waybar/testconfig/style.scss" },
|
||||
-- callback = function()
|
||||
-- vim.cmd(":!sass ~/.config/waybar/testconfig/style.scss ~/.config/waybar/testconfig/teststyle.css")
|
||||
-- end,
|
||||
-- })
|
||||
|
||||
+34
-35
@@ -1,6 +1,5 @@
|
||||
require("CopilotChat").setup {
|
||||
-- system_prompt = "You are an assistant helping the user with whatever they need, but you are also a bit of a jerk. Do not use profanity.",
|
||||
model = "gpt-oss:20b",
|
||||
prompts = {
|
||||
CivitAI = {
|
||||
system_prompt = "You are an assistant helping with stable diffusion models and python to implement failsafes for a server regarding image generation.",
|
||||
@@ -16,38 +15,38 @@ require("CopilotChat").setup {
|
||||
tool = ' Tool: ',
|
||||
},
|
||||
|
||||
providers = {
|
||||
ollama = {
|
||||
embed = 'copilot_embeddings', -- Use Copilot as embedding provider
|
||||
|
||||
-- Copy copilot input and output processing
|
||||
prepare_input = require('CopilotChat.config.providers').copilot.prepare_input,
|
||||
prepare_output = require('CopilotChat.config.providers').copilot.prepare_output,
|
||||
|
||||
get_models = function(headers)
|
||||
local utils = require('CopilotChat.utils')
|
||||
local response, err = utils.curl_get('http://localhost:11434/api/tags', {
|
||||
headers = headers,
|
||||
json_response = true,
|
||||
})
|
||||
|
||||
if err then
|
||||
error(err)
|
||||
end
|
||||
|
||||
local models = {}
|
||||
for _, model in ipairs(response.body.models) do
|
||||
table.insert(models, {
|
||||
id = model.name,
|
||||
name = model.name
|
||||
})
|
||||
end
|
||||
return models
|
||||
end,
|
||||
|
||||
get_url = function()
|
||||
return 'http://localhost:11434/api/chat'
|
||||
end,
|
||||
}
|
||||
}
|
||||
-- providers = {
|
||||
-- ollama = {
|
||||
-- embed = 'copilot_embeddings', -- Use Copilot as embedding provider
|
||||
--
|
||||
-- -- Copy copilot input and output processing
|
||||
-- prepare_input = require('CopilotChat.config.providers').copilot.prepare_input,
|
||||
-- prepare_output = require('CopilotChat.config.providers').copilot.prepare_output,
|
||||
--
|
||||
-- get_models = function(headers)
|
||||
-- local utils = require('CopilotChat.utils')
|
||||
-- local response, err = utils.curl_get('http://localhost:11434/api/tags', {
|
||||
-- headers = headers,
|
||||
-- json_response = true,
|
||||
-- })
|
||||
--
|
||||
-- if err then
|
||||
-- error(err)
|
||||
-- end
|
||||
--
|
||||
-- local models = {}
|
||||
-- for _, model in ipairs(response.body.models) do
|
||||
-- table.insert(models, {
|
||||
-- id = model.name,
|
||||
-- name = model.name
|
||||
-- })
|
||||
-- end
|
||||
-- return models
|
||||
-- end,
|
||||
--
|
||||
-- get_url = function()
|
||||
-- return 'http://localhost:11434/api/chat'
|
||||
-- end,
|
||||
-- }
|
||||
-- }
|
||||
}
|
||||
|
||||
@@ -0,0 +1,9 @@
|
||||
require("lazydev").setup({
|
||||
library = {
|
||||
{ path = "${3rd}/luv/library", words = { "vim%.uv" }},
|
||||
"LazyVim",
|
||||
},
|
||||
enabled = function(root_dir)
|
||||
return vim.g.lazydev_enabled == nil and true or vim.g.lazydev_enabled
|
||||
end,
|
||||
})
|
||||
@@ -7,14 +7,6 @@ local capabilities = vim.tbl_deep_extend(
|
||||
cmp_lsp.default_capabilities()
|
||||
)
|
||||
|
||||
local on_attach = function(client, bufnr)
|
||||
if client and client.server_capabilities.documentHighlightProvider then
|
||||
vim.defer_fn(function()
|
||||
vim.lsp.document_color.enable(false)
|
||||
end, 50)
|
||||
end
|
||||
end
|
||||
|
||||
local cmp_kinds = {
|
||||
Text = ' ',
|
||||
Method = ' ',
|
||||
@@ -46,6 +38,7 @@ local cmp_kinds = {
|
||||
require("fidget").setup({})
|
||||
require("mason").setup()
|
||||
require("mason-lspconfig").setup({
|
||||
automatic_enable = true,
|
||||
ensure_installed = {
|
||||
"lua_ls",
|
||||
"rust_analyzer",
|
||||
@@ -58,11 +51,10 @@ require("mason-lspconfig").setup({
|
||||
}
|
||||
end,
|
||||
|
||||
cssls = function()
|
||||
["css-lsp"] = function()
|
||||
local lspconfig = require("lspconfig")
|
||||
lspconfig.cssls.setup {
|
||||
capabilities = capabilities,
|
||||
on_attach = on_attach,
|
||||
}
|
||||
end,
|
||||
|
||||
|
||||
@@ -5,7 +5,7 @@ require("modicator").setup({
|
||||
bold = false,
|
||||
italic = false,
|
||||
},
|
||||
use_cursorline_background = false,
|
||||
use_cursorline_background = true,
|
||||
},
|
||||
integration = {
|
||||
lualine = {
|
||||
|
||||
@@ -1,14 +0,0 @@
|
||||
require("nvim-tree").setup({
|
||||
sort = {
|
||||
sorter = "case_sensitive",
|
||||
},
|
||||
view = {
|
||||
width = 30,
|
||||
},
|
||||
renderer = {
|
||||
group_empty = true,
|
||||
},
|
||||
filters = {
|
||||
dotfiles = true,
|
||||
},
|
||||
})
|
||||
@@ -11,12 +11,3 @@ vim.g.zig_fmt_autosave = 0
|
||||
vim.api.nvim_set_hl(0, 'GitGutterAdd', { fg = '#009900', ctermfg = 2 })
|
||||
vim.api.nvim_set_hl(0, 'GitGutterChange', { fg = '#bbbb00', ctermfg = 3 })
|
||||
vim.api.nvim_set_hl(0, 'GitGutterDelete', { fg = '#ff2222', ctermfg = 1 })
|
||||
|
||||
local bg_color = vim.api.nvim_get_hl_by_name('Normal', true).background
|
||||
|
||||
vim.api.nvim_set_hl(0, 'WinSeparator', { fg = vim.api.nvim_get_hl_by_name('NvimTreeEndOfBuffer', true).foreground, bg = 'NONE' })
|
||||
vim.api.nvim_set_hl(0, 'NvimTreeWinSeparator', { fg = bg_color, bg = 'NONE' })
|
||||
vim.api.nvim_set_hl(0, 'NvimTreeCursorLine', { bg = vim.api.nvim_get_hl_by_name('CursorLine', true).background })
|
||||
vim.api.nvim_set_hl(0, 'LspReferenceWrite', { bg = vim.api.nvim_get_hl_by_name('CursorLine', true).background })
|
||||
vim.api.nvim_set_hl(0, 'LspReferenceText', { bg = vim.api.nvim_get_hl_by_name('CursorLine', true).background })
|
||||
vim.api.nvim_set_hl(0, 'LspReferenceRead', { bg = vim.api.nvim_get_hl_by_name('CursorLine', true).background })
|
||||
|
||||
+18
-17
@@ -37,13 +37,6 @@ return {
|
||||
{
|
||||
"nvim-tree/nvim-web-devicons",
|
||||
},
|
||||
{
|
||||
"nvim-tree/nvim-tree.lua",
|
||||
cmd = { "NvimTreeToggle", "NvimTreeFocus" },
|
||||
config = function()
|
||||
require("config.nvimtree")
|
||||
end,
|
||||
},
|
||||
{
|
||||
"akinsho/bufferline.nvim",
|
||||
event = "VeryLazy",
|
||||
@@ -60,8 +53,7 @@ return {
|
||||
},
|
||||
{
|
||||
"mawkler/modicator.nvim",
|
||||
init = function()
|
||||
-- These are required for Modicator to work
|
||||
setup = function()
|
||||
vim.o.cursorline = true
|
||||
vim.o.number = true
|
||||
vim.o.termguicolors = true
|
||||
@@ -173,8 +165,20 @@ return {
|
||||
{
|
||||
"notken12/base46-colors",
|
||||
},
|
||||
-- {
|
||||
-- "mason-org/mason-lspconfig.nvim",
|
||||
-- opts = {},
|
||||
-- dependencies = {
|
||||
-- { "mason-org/mason.nvim", opts = {} },
|
||||
-- "neovim/nvim-lspconfig",
|
||||
-- },
|
||||
-- },
|
||||
{
|
||||
"hrsh7th/nvim-cmp",
|
||||
"folke/lazydev.nvim",
|
||||
ft = "lua",
|
||||
opts = function()
|
||||
require("config.lazydev")
|
||||
end,
|
||||
},
|
||||
{
|
||||
"neovim/nvim-lspconfig",
|
||||
@@ -228,11 +232,8 @@ return {
|
||||
{
|
||||
"ziglang/zig.vim",
|
||||
},
|
||||
-- {
|
||||
-- "nicolas-martin/region-folding.nvim",
|
||||
-- event = { "BufReadPost", "BufNewFile" },
|
||||
-- opts = function()
|
||||
-- require("config.region-folding")
|
||||
-- end,
|
||||
-- },
|
||||
{
|
||||
"mg979/vim-visual-multi",
|
||||
branch = "master",
|
||||
},
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user