lua config abd brave origin browser
This commit is contained in:
+127
-102
@@ -174,110 +174,135 @@ require("lazy").setup({
|
|||||||
end,
|
end,
|
||||||
},
|
},
|
||||||
|
|
||||||
{
|
{
|
||||||
"neovim/nvim-lspconfig",
|
"neovim/nvim-lspconfig",
|
||||||
dependencies = {
|
dependencies = {
|
||||||
{ "j-hui/fidget.nvim", opts = {} },
|
{ "j-hui/fidget.nvim", opts = {} },
|
||||||
},
|
},
|
||||||
config = function()
|
config = function()
|
||||||
vim.api.nvim_create_autocmd("LspAttach", {
|
vim.api.nvim_create_autocmd("LspAttach", {
|
||||||
group = vim.api.nvim_create_augroup("kickstart-lsp-attach", { clear = true }),
|
group = vim.api.nvim_create_augroup("kickstart-lsp-attach", { clear = true }),
|
||||||
callback = function(event)
|
callback = function(event)
|
||||||
local map = function(keys, func, desc, mode)
|
local map = function(keys, func, desc, mode)
|
||||||
mode = mode or "n"
|
mode = mode or "n"
|
||||||
vim.keymap.set(mode, keys, func, { buffer = event.buf, desc = "LSP: " .. desc })
|
vim.keymap.set(mode, keys, func, { buffer = event.buf, desc = "LSP: " .. desc })
|
||||||
end
|
|
||||||
|
|
||||||
map("grn", vim.lsp.buf.rename, "[R]e[n]ame")
|
|
||||||
map("gra", vim.lsp.buf.code_action, "[G]oto Code [A]ction", { "n", "x" })
|
|
||||||
map("grD", vim.lsp.buf.declaration, "[G]oto [D]eclaration")
|
|
||||||
|
|
||||||
local client = vim.lsp.get_client_by_id(event.data.client_id)
|
|
||||||
|
|
||||||
if client and client:supports_method("textDocument/documentHighlight", event.buf) then
|
|
||||||
local highlight_augroup =
|
|
||||||
vim.api.nvim_create_augroup("kickstart-lsp-highlight", { clear = false })
|
|
||||||
|
|
||||||
vim.api.nvim_create_autocmd({ "CursorHold", "CursorHoldI" }, {
|
|
||||||
buffer = event.buf,
|
|
||||||
group = highlight_augroup,
|
|
||||||
callback = vim.lsp.buf.document_highlight,
|
|
||||||
})
|
|
||||||
|
|
||||||
vim.api.nvim_create_autocmd({ "CursorMoved", "CursorMovedI" }, {
|
|
||||||
buffer = event.buf,
|
|
||||||
group = highlight_augroup,
|
|
||||||
callback = vim.lsp.buf.clear_references,
|
|
||||||
})
|
|
||||||
|
|
||||||
vim.api.nvim_create_autocmd("LspDetach", {
|
|
||||||
group = vim.api.nvim_create_augroup("kickstart-lsp-detach", { clear = true }),
|
|
||||||
callback = function(event2)
|
|
||||||
vim.lsp.buf.clear_references()
|
|
||||||
vim.api.nvim_clear_autocmds({
|
|
||||||
group = "kickstart-lsp-highlight",
|
|
||||||
buffer = event2.buf,
|
|
||||||
})
|
|
||||||
end,
|
|
||||||
})
|
|
||||||
end
|
|
||||||
|
|
||||||
if client and client:supports_method("textDocument/inlayHint", event.buf) then
|
|
||||||
map("<leader>th", function()
|
|
||||||
vim.lsp.inlay_hint.enable(not vim.lsp.inlay_hint.is_enabled({ bufnr = event.buf }))
|
|
||||||
end, "[T]oggle Inlay [H]ints")
|
|
||||||
end
|
|
||||||
end,
|
|
||||||
})
|
|
||||||
|
|
||||||
local servers = {
|
|
||||||
clangd = {},
|
|
||||||
zls = {},
|
|
||||||
gopls = {},
|
|
||||||
rust_analyzer = {},
|
|
||||||
omnisharp = {},
|
|
||||||
jdtls = {},
|
|
||||||
|
|
||||||
ts_ls = {},
|
|
||||||
|
|
||||||
lua_ls = {
|
|
||||||
on_init = function(client)
|
|
||||||
if client.workspace_folders then
|
|
||||||
local path = client.workspace_folders[1].name
|
|
||||||
if
|
|
||||||
path ~= vim.fn.stdpath("config")
|
|
||||||
and (vim.uv.fs_stat(path .. "/.luarc.json") or vim.uv.fs_stat(path .. "/.luarc.jsonc"))
|
|
||||||
then
|
|
||||||
return
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
|
|
||||||
client.config.settings.Lua = vim.tbl_deep_extend("force", client.config.settings.Lua, {
|
map("grn", vim.lsp.buf.rename, "[R]e[n]ame")
|
||||||
runtime = {
|
map("gra", vim.lsp.buf.code_action, "[G]oto Code [A]ction", { "n", "x" })
|
||||||
version = "LuaJIT",
|
map("grD", vim.lsp.buf.declaration, "[G]oto [D]eclaration")
|
||||||
path = { "lua/?.lua", "lua/?/init.lua" },
|
|
||||||
},
|
|
||||||
workspace = {
|
|
||||||
checkThirdParty = false,
|
|
||||||
library = vim.tbl_extend("force", vim.api.nvim_get_runtime_file("", true), {
|
|
||||||
"${3rd}/luv/library",
|
|
||||||
"${3rd}/busted/library",
|
|
||||||
}),
|
|
||||||
},
|
|
||||||
})
|
|
||||||
end,
|
|
||||||
settings = {
|
|
||||||
Lua = {},
|
|
||||||
},
|
|
||||||
},
|
|
||||||
}
|
|
||||||
|
|
||||||
for name, server in pairs(servers) do
|
local client = vim.lsp.get_client_by_id(event.data.client_id)
|
||||||
vim.lsp.config(name, server)
|
|
||||||
vim.lsp.enable(name)
|
if client and client:supports_method("textDocument/documentHighlight", event.buf) then
|
||||||
end
|
local highlight_augroup =
|
||||||
end,
|
vim.api.nvim_create_augroup("kickstart-lsp-highlight", { clear = false })
|
||||||
},
|
|
||||||
|
vim.api.nvim_create_autocmd({ "CursorHold", "CursorHoldI" }, {
|
||||||
|
buffer = event.buf,
|
||||||
|
group = highlight_augroup,
|
||||||
|
callback = vim.lsp.buf.document_highlight,
|
||||||
|
})
|
||||||
|
|
||||||
|
vim.api.nvim_create_autocmd({ "CursorMoved", "CursorMovedI" }, {
|
||||||
|
buffer = event.buf,
|
||||||
|
group = highlight_augroup,
|
||||||
|
callback = vim.lsp.buf.clear_references,
|
||||||
|
})
|
||||||
|
|
||||||
|
vim.api.nvim_create_autocmd("LspDetach", {
|
||||||
|
group = vim.api.nvim_create_augroup("kickstart-lsp-detach", { clear = true }),
|
||||||
|
callback = function(event2)
|
||||||
|
vim.lsp.buf.clear_references()
|
||||||
|
vim.api.nvim_clear_autocmds({
|
||||||
|
group = "kickstart-lsp-highlight",
|
||||||
|
buffer = event2.buf,
|
||||||
|
})
|
||||||
|
end,
|
||||||
|
})
|
||||||
|
end
|
||||||
|
|
||||||
|
if client and client:supports_method("textDocument/inlayHint", event.buf) then
|
||||||
|
map("<leader>th", function()
|
||||||
|
vim.lsp.inlay_hint.enable(not vim.lsp.inlay_hint.is_enabled({ bufnr = event.buf }))
|
||||||
|
end, "[T]oggle Inlay [H]ints")
|
||||||
|
end
|
||||||
|
end,
|
||||||
|
})
|
||||||
|
|
||||||
|
local servers = {
|
||||||
|
clangd = {},
|
||||||
|
zls = {},
|
||||||
|
gopls = {},
|
||||||
|
rust_analyzer = {},
|
||||||
|
omnisharp = {},
|
||||||
|
jdtls = {},
|
||||||
|
|
||||||
|
ts_ls = {},
|
||||||
|
|
||||||
|
lua_ls = {
|
||||||
|
on_init = function(client)
|
||||||
|
if client.workspace_folders then
|
||||||
|
local path = client.workspace_folders[1].name
|
||||||
|
if
|
||||||
|
path ~= vim.fn.stdpath("config")
|
||||||
|
and (vim.uv.fs_stat(path .. "/.luarc.json") or vim.uv.fs_stat(path .. "/.luarc.jsonc"))
|
||||||
|
then
|
||||||
|
return
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
client.config.settings.Lua = vim.tbl_deep_extend("force", client.config.settings.Lua, {
|
||||||
|
runtime = {
|
||||||
|
version = "LuaJIT",
|
||||||
|
path = { "lua/?.lua", "lua/?/init.lua" },
|
||||||
|
},
|
||||||
|
workspace = {
|
||||||
|
checkThirdParty = false,
|
||||||
|
library = vim.tbl_extend("force", vim.api.nvim_get_runtime_file("", true), {
|
||||||
|
"${3rd}/luv/library",
|
||||||
|
"${3rd}/busted/library",
|
||||||
|
}),
|
||||||
|
},
|
||||||
|
})
|
||||||
|
end,
|
||||||
|
settings = {
|
||||||
|
Lua = {},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
}
|
||||||
|
|
||||||
|
for name, server in pairs(servers) do
|
||||||
|
vim.lsp.config(name, server)
|
||||||
|
vim.lsp.enable(name)
|
||||||
|
end
|
||||||
|
end,
|
||||||
|
},
|
||||||
|
|
||||||
|
{
|
||||||
|
"ray-x/go.nvim",
|
||||||
|
dependencies = {
|
||||||
|
"ray-x/guihua.lua",
|
||||||
|
"neovim/nvim-lspconfig",
|
||||||
|
"nvim-treesitter/nvim-treesitter",
|
||||||
|
"L3MON4D3/LuaSnip",
|
||||||
|
},
|
||||||
|
event = { "CmdlineEnter" },
|
||||||
|
ft = { "go", "gomod", "gowork", "gotmpl" },
|
||||||
|
build = ':lua require("go.install").update_all_sync()',
|
||||||
|
opts = {},
|
||||||
|
config = function(_, opts)
|
||||||
|
require("go").setup(opts)
|
||||||
|
local format_sync_grp = vim.api.nvim_create_augroup("GoFormat", { clear = true })
|
||||||
|
vim.api.nvim_create_autocmd("BufWritePre", {
|
||||||
|
pattern = "*.go",
|
||||||
|
callback = function()
|
||||||
|
require("go.format").goimports()
|
||||||
|
end,
|
||||||
|
group = format_sync_grp,
|
||||||
|
})
|
||||||
|
end,
|
||||||
|
},
|
||||||
|
|
||||||
{
|
{
|
||||||
"stevearc/conform.nvim",
|
"stevearc/conform.nvim",
|
||||||
@@ -383,6 +408,7 @@ require("lazy").setup({
|
|||||||
config = function()
|
config = function()
|
||||||
require("mini.ai").setup({ n_lines = 500 })
|
require("mini.ai").setup({ n_lines = 500 })
|
||||||
require("mini.surround").setup()
|
require("mini.surround").setup()
|
||||||
|
require("mini.pairs").setup()
|
||||||
local statusline = require("mini.statusline")
|
local statusline = require("mini.statusline")
|
||||||
statusline.setup({ use_icons = vim.g.have_nerd_font })
|
statusline.setup({ use_icons = vim.g.have_nerd_font })
|
||||||
---@diagnostic disable-next-line: duplicate-set-field
|
---@diagnostic disable-next-line: duplicate-set-field
|
||||||
@@ -487,4 +513,3 @@ require("lazy").setup({
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|||||||
@@ -3,13 +3,15 @@
|
|||||||
"blink.cmp": { "branch": "main", "commit": "78336bc89ee5365633bcf754d93df01678b5c08f" },
|
"blink.cmp": { "branch": "main", "commit": "78336bc89ee5365633bcf754d93df01678b5c08f" },
|
||||||
"conform.nvim": { "branch": "master", "commit": "619363c30309d29ffa631e67c8183f2a72caa373" },
|
"conform.nvim": { "branch": "master", "commit": "619363c30309d29ffa631e67c8183f2a72caa373" },
|
||||||
"fidget.nvim": { "branch": "main", "commit": "6f793b2bcd2d35e201c09520f698bb763220908a" },
|
"fidget.nvim": { "branch": "main", "commit": "6f793b2bcd2d35e201c09520f698bb763220908a" },
|
||||||
"gitsigns.nvim": { "branch": "main", "commit": "2038c666bd9d8a0b7349a0b6ee00dc83104b9ecf" },
|
"gitsigns.nvim": { "branch": "main", "commit": "eb60cc7b94c46005237fd34170d76f3a089a90aa" },
|
||||||
|
"go.nvim": { "branch": "master", "commit": "0768d79bbebdb1a112a845f9cd6293bfbd544dab" },
|
||||||
"guess-indent.nvim": { "branch": "main", "commit": "84a4987ff36798c2fc1169cbaff67960aed9776f" },
|
"guess-indent.nvim": { "branch": "main", "commit": "84a4987ff36798c2fc1169cbaff67960aed9776f" },
|
||||||
"lazy.nvim": { "branch": "main", "commit": "85c7ff3711b730b4030d03144f6db6375044ae82" },
|
"guihua.lua": { "branch": "master", "commit": "4c513d5dac550af77034cced421967b393261509" },
|
||||||
"mini.nvim": { "branch": "main", "commit": "7c2caf0ae915d819f2f39467d6bb9313c2b3e90a" },
|
"lazy.nvim": { "branch": "main", "commit": "306a05526ada86a7b30af95c5cc81ffba93fef97" },
|
||||||
"nvim-lspconfig": { "branch": "master", "commit": "3371bf298c1f56efc26771ee961f461176958fb5" },
|
"mini.nvim": { "branch": "main", "commit": "db41c4076105a63caec12612d11228348f55a109" },
|
||||||
|
"nvim-lspconfig": { "branch": "master", "commit": "2c227d59589957fa4404b7de5f61d72c0a78a62d" },
|
||||||
"nvim-treesitter": { "branch": "main", "commit": "4916d6592ede8c07973490d9322f187e07dfefac" },
|
"nvim-treesitter": { "branch": "main", "commit": "4916d6592ede8c07973490d9322f187e07dfefac" },
|
||||||
"nvim-web-devicons": { "branch": "master", "commit": "dfbfaa967a6f7ec50789bead7ef87e336c1fa63c" },
|
"nvim-web-devicons": { "branch": "master", "commit": "09d1324e264c6950262dbe02a9bce2933a6800db" },
|
||||||
"plenary.nvim": { "branch": "master", "commit": "74b06c6c75e4eeb3108ec01852001636d85a932b" },
|
"plenary.nvim": { "branch": "master", "commit": "74b06c6c75e4eeb3108ec01852001636d85a932b" },
|
||||||
"telescope-fzf-native.nvim": { "branch": "main", "commit": "b25b749b9db64d375d782094e2b9dce53ad53a40" },
|
"telescope-fzf-native.nvim": { "branch": "main", "commit": "b25b749b9db64d375d782094e2b9dce53ad53a40" },
|
||||||
"telescope-ui-select.nvim": { "branch": "master", "commit": "6e51d7da30bd139a6950adf2a47fda6df9fa06d2" },
|
"telescope-ui-select.nvim": { "branch": "master", "commit": "6e51d7da30bd139a6950adf2a47fda6df9fa06d2" },
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
# Sway workstation configuration translated from NixOS behavior.
|
# Sway workstation configuration translated from NixOS behavior.
|
||||||
set $mod Mod4
|
set $mod Mod4
|
||||||
set $term foot -e tmux new-session -A -s main
|
set $term foot -e tmux new-session -A -s main
|
||||||
set $browser zen
|
set $browser brave-origin
|
||||||
set $menu rofi -show drun
|
set $menu rofi -show drun
|
||||||
|
|
||||||
font pango:DejaVu Sans Mono 10
|
font pango:DejaVu Sans Mono 10
|
||||||
|
|||||||
@@ -3,8 +3,8 @@
|
|||||||
"position": "top",
|
"position": "top",
|
||||||
"height": 34,
|
"height": 34,
|
||||||
"margin-top": 8,
|
"margin-top": 8,
|
||||||
"margin-left": 320,
|
"margin-left": 240,
|
||||||
"margin-right": 320,
|
"margin-right": 240,
|
||||||
"modules-left": [
|
"modules-left": [
|
||||||
"sway/workspaces",
|
"sway/workspaces",
|
||||||
"sway/window"
|
"sway/window"
|
||||||
|
|||||||
Reference in New Issue
Block a user