remove nvim-tree, clean useless autocmds
This commit is contained in:
@@ -16,3 +16,7 @@ vim.filetype.add({
|
|||||||
})
|
})
|
||||||
|
|
||||||
vim.cmd[[colorscheme onedark]]
|
vim.cmd[[colorscheme onedark]]
|
||||||
|
|
||||||
|
-- vim.lsp.document_color = {
|
||||||
|
-- enable = false
|
||||||
|
-- }
|
||||||
|
|||||||
+3
-91
@@ -1,95 +1,7 @@
|
|||||||
local autocmd = vim.api.nvim_create_autocmd
|
local autocmd = vim.api.nvim_create_autocmd
|
||||||
|
|
||||||
autocmd({'BufEnter', 'QuitPre'}, {
|
autocmd("LspAttach", {
|
||||||
nested = false,
|
callback = function(args)
|
||||||
callback = function(e)
|
vim.lsp.document_color.enable(false, args.buf, { "background" })
|
||||||
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
|
|
||||||
end,
|
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 {
|
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.",
|
-- 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 = {
|
prompts = {
|
||||||
CivitAI = {
|
CivitAI = {
|
||||||
system_prompt = "You are an assistant helping with stable diffusion models and python to implement failsafes for a server regarding image generation.",
|
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: ',
|
tool = ' Tool: ',
|
||||||
},
|
},
|
||||||
|
|
||||||
providers = {
|
-- providers = {
|
||||||
ollama = {
|
-- ollama = {
|
||||||
embed = 'copilot_embeddings', -- Use Copilot as embedding provider
|
-- embed = 'copilot_embeddings', -- Use Copilot as embedding provider
|
||||||
|
--
|
||||||
-- Copy copilot input and output processing
|
-- -- Copy copilot input and output processing
|
||||||
prepare_input = require('CopilotChat.config.providers').copilot.prepare_input,
|
-- prepare_input = require('CopilotChat.config.providers').copilot.prepare_input,
|
||||||
prepare_output = require('CopilotChat.config.providers').copilot.prepare_output,
|
-- prepare_output = require('CopilotChat.config.providers').copilot.prepare_output,
|
||||||
|
--
|
||||||
get_models = function(headers)
|
-- get_models = function(headers)
|
||||||
local utils = require('CopilotChat.utils')
|
-- local utils = require('CopilotChat.utils')
|
||||||
local response, err = utils.curl_get('http://localhost:11434/api/tags', {
|
-- local response, err = utils.curl_get('http://localhost:11434/api/tags', {
|
||||||
headers = headers,
|
-- headers = headers,
|
||||||
json_response = true,
|
-- json_response = true,
|
||||||
})
|
-- })
|
||||||
|
--
|
||||||
if err then
|
-- if err then
|
||||||
error(err)
|
-- error(err)
|
||||||
end
|
-- end
|
||||||
|
--
|
||||||
local models = {}
|
-- local models = {}
|
||||||
for _, model in ipairs(response.body.models) do
|
-- for _, model in ipairs(response.body.models) do
|
||||||
table.insert(models, {
|
-- table.insert(models, {
|
||||||
id = model.name,
|
-- id = model.name,
|
||||||
name = model.name
|
-- name = model.name
|
||||||
})
|
-- })
|
||||||
end
|
-- end
|
||||||
return models
|
-- return models
|
||||||
end,
|
-- end,
|
||||||
|
--
|
||||||
get_url = function()
|
-- get_url = function()
|
||||||
return 'http://localhost:11434/api/chat'
|
-- return 'http://localhost:11434/api/chat'
|
||||||
end,
|
-- 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()
|
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 = {
|
local cmp_kinds = {
|
||||||
Text = ' ',
|
Text = ' ',
|
||||||
Method = ' ',
|
Method = ' ',
|
||||||
@@ -46,6 +38,7 @@ local cmp_kinds = {
|
|||||||
require("fidget").setup({})
|
require("fidget").setup({})
|
||||||
require("mason").setup()
|
require("mason").setup()
|
||||||
require("mason-lspconfig").setup({
|
require("mason-lspconfig").setup({
|
||||||
|
automatic_enable = true,
|
||||||
ensure_installed = {
|
ensure_installed = {
|
||||||
"lua_ls",
|
"lua_ls",
|
||||||
"rust_analyzer",
|
"rust_analyzer",
|
||||||
@@ -58,11 +51,10 @@ require("mason-lspconfig").setup({
|
|||||||
}
|
}
|
||||||
end,
|
end,
|
||||||
|
|
||||||
cssls = function()
|
["css-lsp"] = function()
|
||||||
local lspconfig = require("lspconfig")
|
local lspconfig = require("lspconfig")
|
||||||
lspconfig.cssls.setup {
|
lspconfig.cssls.setup {
|
||||||
capabilities = capabilities,
|
capabilities = capabilities,
|
||||||
on_attach = on_attach,
|
|
||||||
}
|
}
|
||||||
end,
|
end,
|
||||||
|
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ require("modicator").setup({
|
|||||||
bold = false,
|
bold = false,
|
||||||
italic = false,
|
italic = false,
|
||||||
},
|
},
|
||||||
use_cursorline_background = false,
|
use_cursorline_background = true,
|
||||||
},
|
},
|
||||||
integration = {
|
integration = {
|
||||||
lualine = {
|
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, 'GitGutterAdd', { fg = '#009900', ctermfg = 2 })
|
||||||
vim.api.nvim_set_hl(0, 'GitGutterChange', { fg = '#bbbb00', ctermfg = 3 })
|
vim.api.nvim_set_hl(0, 'GitGutterChange', { fg = '#bbbb00', ctermfg = 3 })
|
||||||
vim.api.nvim_set_hl(0, 'GitGutterDelete', { fg = '#ff2222', ctermfg = 1 })
|
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-web-devicons",
|
||||||
},
|
},
|
||||||
{
|
|
||||||
"nvim-tree/nvim-tree.lua",
|
|
||||||
cmd = { "NvimTreeToggle", "NvimTreeFocus" },
|
|
||||||
config = function()
|
|
||||||
require("config.nvimtree")
|
|
||||||
end,
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
"akinsho/bufferline.nvim",
|
"akinsho/bufferline.nvim",
|
||||||
event = "VeryLazy",
|
event = "VeryLazy",
|
||||||
@@ -60,8 +53,7 @@ return {
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"mawkler/modicator.nvim",
|
"mawkler/modicator.nvim",
|
||||||
init = function()
|
setup = function()
|
||||||
-- These are required for Modicator to work
|
|
||||||
vim.o.cursorline = true
|
vim.o.cursorline = true
|
||||||
vim.o.number = true
|
vim.o.number = true
|
||||||
vim.o.termguicolors = true
|
vim.o.termguicolors = true
|
||||||
@@ -173,8 +165,20 @@ return {
|
|||||||
{
|
{
|
||||||
"notken12/base46-colors",
|
"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",
|
"neovim/nvim-lspconfig",
|
||||||
@@ -228,11 +232,8 @@ return {
|
|||||||
{
|
{
|
||||||
"ziglang/zig.vim",
|
"ziglang/zig.vim",
|
||||||
},
|
},
|
||||||
-- {
|
{
|
||||||
-- "nicolas-martin/region-folding.nvim",
|
"mg979/vim-visual-multi",
|
||||||
-- event = { "BufReadPost", "BufNewFile" },
|
branch = "master",
|
||||||
-- opts = function()
|
},
|
||||||
-- require("config.region-folding")
|
|
||||||
-- end,
|
|
||||||
-- },
|
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user