Updated config

This commit is contained in:
Eduard Urbach 2024-03-03 17:47:02 +01:00
parent 4ac1314fad
commit acfceb3c65
Signed by: akyoto
GPG Key ID: C874F672B1AF20C0
18 changed files with 207 additions and 87 deletions

View File

@ -1,7 +1,3 @@
# Cursor
env = XCURSOR_SIZE,24
env = WLR_NO_HARDWARE_CURSORS,1
# Firefox
env = MOZ_ENABLE_WAYLAND,1
@ -25,3 +21,10 @@ env = SSH_AUTH_SOCK,$XDG_RUNTIME_DIR/gcr/ssh
# Wayland
env = XDG_SESSION_TYPE,wayland
env = GDK_BACKEND,wayland
# Wlroots
env = WLR_NO_HARDWARE_CURSORS,1
env = WLR_RENDERER,vulkan
# X11
env = XCURSOR_SIZE,24

View File

@ -5,6 +5,6 @@ $files = nautilus
$logout = wlogout
$lockscreen = swaylock
$menu = pkill fuzzel || fuzzel
$screenshot = grim -g "$(slurp -d)" - | wl-copy
$screenshot = IMG=~/pictures/screenshots/$(date +%Y-%m-%d_%H-%M-%S).png && grim -g "$(slurp -d)" $IMG && wl-copy < $IMG
$statusbar = ~/.bin/launch-waybar
$terminal = alacritty

View File

@ -1,4 +1,5 @@
require("config.settings")
require("settings")
require("boot")
require("config.keys")
require("config.autocmds")
require("setup")
require("keys")
require("autocmds")

View File

@ -4,13 +4,14 @@
"gitsigns.nvim": { "branch": "main", "commit": "2c2463dbd82eddd7dbab881c3a62cfbfbe3c67ae" },
"lazy.nvim": { "branch": "main", "commit": "aedcd79811d491b60d0a6577a9c1701063c2a609" },
"mini.completion": { "branch": "main", "commit": "0cf6c4e257b5e8189ac6b3ffa2064a319c4eb8a8" },
"neodev.nvim": { "branch": "main", "commit": "84e0290f5600e8b89c0dfcafc864f45496a53400" },
"mini.surround": { "branch": "main", "commit": "a1b590cc3b676512de507328d6bbab5e43794720" },
"noice.nvim": { "branch": "main", "commit": "bf67d70bd7265d075191e7812d8eb42b9791f737" },
"nui.nvim": { "branch": "main", "commit": "b81333d12f824dbed5eb231c8a4409a290fdd848" },
"nvim-lspconfig": { "branch": "master", "commit": "9553725789be682ecd945a527ec552e489ea8534" },
"nvim-autopairs": { "branch": "master", "commit": "c6139ca0d5ad7af129ea6c89cb4c56093f2c034a" },
"nvim-lspconfig": { "branch": "master", "commit": "c932a56bf25167b1e88d2a1ebe35bb774b41019a" },
"nvim-notify": { "branch": "master", "commit": "5371f4bfc1f6d3adf4fe9d62cd3a9d44356bfd15" },
"nvim-tree.lua": { "branch": "master", "commit": "d52fdeb0a300ac42b9cfa65ae0600a299f8e8677" },
"nvim-treesitter": { "branch": "master", "commit": "e3e5ff4ebddcbfa8f5798253ebd1f9b449e8ee69" },
"nvim-tree.lua": { "branch": "master", "commit": "efafd73efa9bc8c26282aed563ba0f01c7465b06" },
"nvim-treesitter": { "branch": "master", "commit": "63ca90eaa3ce1cc668add8828a9e3d6728dbbdf1" },
"nvim-web-devicons": { "branch": "master", "commit": "4adea17610d140a99c313e3f79a9dc01825d59ae" },
"onedark.nvim": { "branch": "master", "commit": "1230aaf2a427b2c5b73aba6e4a9a5881d3e69429" },
"plenary.nvim": { "branch": "master", "commit": "4f71c0c4a196ceb656c824a70792f3df3ce6bb6d" },

View File

@ -1,16 +1,24 @@
local on = vim.api.nvim_create_autocmd
on({ "BufNewFile", "BufRead" }, {
pattern = { "*.txt", "*.md" },
callback = function()
vim.opt_local.wrap = true
vim.opt_local.signcolumn = "no"
end,
})
on({ "TermOpen", "TermEnter" }, {
callback = function()
vim.opt_local.signcolumn = "no"
end,
})
on({ "BufNewFile", "BufRead" }, {
pattern = { "*.txt", "*.md" },
on({ "TextYankPost" }, {
desc = "Highlight when copying text",
group = vim.api.nvim_create_augroup("highlight-yank", { clear = true }),
callback = function()
vim.opt_local.wrap = true
vim.opt_local.signcolumn = "no"
vim.highlight.on_yank()
end,
})

View File

@ -10,45 +10,3 @@ if not vim.loop.fs_stat(lazypath) then
})
end
vim.opt.rtp:prepend(lazypath)
require("lazy").setup("plugins", {
defaults = {
lazy = true,
},
change_detection = {
notify = false
},
performance = {
rtp = {
disabled_plugins = {
"2html_plugin",
"tohtml",
"getscript",
"getscriptPlugin",
"gzip",
"logipat",
"netrw",
"netrwPlugin",
"netrwSettings",
"netrwFileHandlers",
"matchit",
"tar",
"tarPlugin",
"rrhelper",
"spellfile_plugin",
"vimball",
"vimballPlugin",
"zip",
"zipPlugin",
"tutor",
"rplugin",
"syntax",
"synmenu",
"optwin",
"compiler",
"bugreport",
"ftplugin",
},
},
},
})

View File

@ -0,0 +1,11 @@
return {
"j-hui/fidget.nvim",
opts = {
integration = {
["nvim-tree"] = {
enable = true,
},
},
},
config = true,
}

View File

@ -0,0 +1,15 @@
return {
"lukas-reineke/indent-blankline.nvim",
event = "VeryLazy",
main = "ibl",
opts = {
indent = {
char = "",
},
scope = {
enabled = true,
show_start = false,
},
},
config = true,
}

View File

@ -0,0 +1,4 @@
return {
"mrded/nvim-lsp-notify",
config = true,
}

View File

@ -6,20 +6,24 @@ end
map("n", ";", ":", "Command mode")
map("n", "U", "<cmd>redo<cr>", "Redo")
map({ "i", "n" }, "<esc>", "<cmd>noh<cr><esc>", "Clear search")
map({ "i", "n", "s", "v" }, "<C-s>", "<cmd>w<cr><esc>", "Save file")
map("n", "<C-l>", "^Da", "Rewrite line")
map("i", "<C-l>", "<esc>^Da", "Rewrite line")
map("n", "<C-a>", "ggVG", "Select all")
map({"n", "v"}, "qq", "<cmd>qa!<cr>", "Quit all")
-- Editing lines
map({ "n", "v" }, "<C-b>", "^", "Beginning of line")
map("i", "<C-b>", "<esc>^i", "Beginning of line")
map({ "i", "n", "v" }, "<C-e>", "<end>", "End of line")
map("n", "qq", "<cmd>qa!<cr>", "Quit all")
map("n", "<C-l>", "^Da", "Rewrite line")
map("i", "<C-l>", "<esc>^Da", "Rewrite line")
map("v", "<C-l>", "V", "Select line")
map({"n", "v"}, "<C-a>", "<esc>ggVG", "Select all")
-- Editing multiple instances
map("n", "<C-d>", "*#", "Search word under cursor")
map("n", "<C-r>", "*#:%s//<C-r><C-w>", "Replace word under cursor")
map("n", "<f3>", "*#", "Search word under cursor")
map("v", "<f3>", "y/<C-r>\"<cr>N", "Search selection")
map("n", "<C-d>", "viw", "Select word under cursor")
map("v", "<C-d>", "y/<C-r>\"<cr>N", "Search selection")
map("v", "<C-r>", "y/<C-r>\"<cr>N:%s//<C-r>\"", "Replace selection")
map("n", "<C-r>", "*#:%s//<C-r><C-w>/g<left><left>", "Replace word under cursor")
map("v", "<C-r>", "y/<C-r>\"<cr>N:%s//<C-r>\"/g<left><left>", "Replace selection")
-- Increasing and decreasing numbers
map("n", "+", "<C-a>", "Increase number")
@ -29,6 +33,7 @@ map("n", "<kMinus>", "<C-x>", "Decrease number")
-- Buffer management
map("n", "<C-n>", "<cmd>enew<cr>", "New file")
map({ "i", "n", "s", "v" }, "<C-s>", "<cmd>w<cr><esc>", "Save file")
map("n", "<C-q>", "<cmd>bd<cr>", "Delete buffer")
-- Copy and paste
@ -36,8 +41,10 @@ map("v", "<C-c>", "y")
map("n", "<C-v>", '"+p')
-- Indenting
map("v", "<", "<gv")
map("v", ">", ">gv")
map("n", "<Tab>", "V>gv<esc>")
map("n", "<S-Tab>", "V<gv<esc>")
map("v", "<Tab>", ">gv")
map("v", "<S-Tab>", "<gv")
-- Shift arrow selection
map("n", "<S-Up>", "v<Up>")
@ -55,13 +62,5 @@ map("i", "<S-Down>", "<Esc>v<Down>")
map("i", "<S-Left>", "<Esc>v<Left>")
map("i", "<S-Right>", "<Esc>v<Right>")
-- LSP
map("n", "gr", vim.lsp.buf.references, "References")
map("n", "gd", vim.lsp.buf.definition, "Definition")
map({ "n", "i" }, "<f1>", vim.lsp.buf.hover, "Hover")
map({ "n", "i" }, "<f2>", vim.lsp.buf.rename, "Rename")
map({ "n", "i" }, "<C-f>", vim.lsp.buf.format, "Format")
map("n", "<leader>ca", vim.lsp.buf.code_action, "Code action")
-- Package manager
map("n", "<leader>l", "<cmd>Lazy<cr>", "Lazy")

View File

@ -0,0 +1,5 @@
return {
"windwp/nvim-autopairs",
event = "InsertEnter",
config = true
}

View File

@ -1,7 +1,9 @@
return {
"folke/flash.nvim",
event = { "BufReadPost", "BufNewFile" },
keys = {
{ "s", function() require("flash").jump() end, mode = { "n", "x", "o" }, desc = "Flash" },
{ "S", function() require("flash").treesitter() end, mode = { "n", "o", "x" }, desc = "Flash Treesitter" },
{ "s", function() require("flash").jump() end, mode = { "n", "o", "x" }, desc = "Flash" },
{ "S", function() require("flash").treesitter() end, mode = { "n", "o", "x" }, desc = "Flash Treesitter" },
},
config = true,
}

View File

@ -1,9 +1,6 @@
return {
"neovim/nvim-lspconfig",
event = { "BufReadPre", "BufNewFile" },
dependencies = {
"folke/neodev.nvim",
},
opts = {
servers = {
clangd = {},
@ -12,8 +9,18 @@ return {
lua_ls = {
settings = {
Lua = {
completion = {
callSnippet = "Replace",
},
runtime = {
version = "LuaJIT",
},
workspace = {
checkThirdParty = false,
library = {
"${3rd}/luv/library",
unpack(vim.api.nvim_get_runtime_file("", true)),
},
},
},
},
@ -21,8 +28,6 @@ return {
},
},
config = function(_, opts)
require("neodev").setup()
-- Servers
local servers = opts.servers
@ -42,5 +47,37 @@ return {
name = "DiagnosticSign" .. name
vim.fn.sign_define(name, { text = icon, texthl = name, numhl = "" })
end
-- Runs when the LSP is attached
vim.api.nvim_create_autocmd("LspAttach", {
group = vim.api.nvim_create_augroup("lsp-attach", { clear = true }),
callback = function(event)
local function map(mode, lhs, rhs, info)
vim.keymap.set(mode, lhs, rhs, { buffer = event.buf, desc = "LSP: " .. info })
end
map("n", "gr", require("telescope.builtin").lsp_references, "References")
map("n", "gd", require("telescope.builtin").lsp_definitions, "Definition")
map({ "n", "i" }, "<f1>", vim.lsp.buf.hover, "Hover")
map({ "n", "i" }, "<f2>", vim.lsp.buf.rename, "Rename")
map({ "n", "i" }, "<C-f>", vim.lsp.buf.format, "Format")
map("n", "<leader>ca", vim.lsp.buf.code_action, "Code action")
-- Highlight the word your cursor is on
-- local client = vim.lsp.get_client_by_id(event.data.client_id)
--
-- if client and client.server_capabilities.documentHighlightProvider then
-- vim.api.nvim_create_autocmd({ "CursorHold", "CursorHoldI" }, {
-- buffer = event.buf,
-- callback = vim.lsp.buf.document_highlight,
-- })
--
-- vim.api.nvim_create_autocmd({ "CursorMoved", "CursorMovedI" }, {
-- buffer = event.buf,
-- callback = vim.lsp.buf.clear_references,
-- })
-- end
end,
})
end,
}

View File

@ -0,0 +1,18 @@
return {
"echasnovski/mini.surround",
event = { "BufReadPost", "BufNewFile" },
opts = {
mappings = {
add = 'gsa',
delete = 'gsd',
find = 'gsf',
find_left = 'gsF',
highlight = 'gsh',
replace = 'gsr',
update_n_lines = 'gsn',
suffix_last = '',
suffix_next = '',
},
},
config = true,
}

View File

@ -3,7 +3,6 @@ return {
event = "VeryLazy",
dependencies = {
"MunifTanjim/nui.nvim",
"rcarriga/nvim-notify",
},
opts = {
lsp = {

View File

@ -3,12 +3,17 @@ return {
dependencies = {
"nvim-lua/plenary.nvim",
"nvim-telescope/telescope-project.nvim",
-- "nvim-telescope/telescope-ui-select.nvim",
},
keys = {
{"<leader>f", "<cmd>Telescope find_files<cr>", desc = "Find files"},
{"<leader>r", "<cmd>Telescope oldfiles<cr>", desc = "Recent files"},
{"<leader>p", "<cmd>Telescope project<cr>", desc = "Projects"},
{"<leader>b", "<cmd>Telescope buffers<cr>", desc = "Buffers"},
{"<leader>f", "<cmd>Telescope find_files<cr>", desc = "Find files"},
{"<leader>h", "<cmd>Telescope help_tags<cr>", desc = "Help"},
{"<leader>p", "<cmd>Telescope project<cr>", desc = "Projects"},
{"<leader>r", "<cmd>Telescope oldfiles<cr>", desc = "Recent files"},
{"<leader>w", "<cmd>Telescope grep_string<cr>", desc = "Word"},
{"<leader>ds", "<cmd>Telescope lsp_document_symbols<cr>", desc = "Document symbols"},
{"<leader>ws", "<cmd>Telescope lsp_dynamic_workspace_symbols<cr>", desc = "Workspace symbols"},
},
config = function()
require("telescope").setup({
@ -30,8 +35,13 @@ return {
sync_with_nvim_tree = true,
theme = "dropdown",
},
-- ["ui-select"] = {
-- require("telescope.themes").get_dropdown(),
-- },
},
})
require("telescope").load_extension("project")
-- require("telescope").load_extension("ui-select")
end,
}

View File

@ -0,0 +1,49 @@
require("lazy").setup("plugins", {
defaults = {
lazy = true,
},
change_detection = {
notify = false
},
ui = {
icons = {
ft = "",
lazy = "󰂠 ",
loaded = "",
not_loaded = "",
},
},
performance = {
rtp = {
disabled_plugins = {
"2html_plugin",
"tohtml",
"getscript",
"getscriptPlugin",
"gzip",
"logipat",
"netrw",
"netrwPlugin",
"netrwSettings",
"netrwFileHandlers",
"matchit",
"tar",
"tarPlugin",
"rrhelper",
"spellfile_plugin",
"vimball",
"vimballPlugin",
"zip",
"zipPlugin",
"tutor",
"rplugin",
"syntax",
"synmenu",
"optwin",
"compiler",
"bugreport",
"ftplugin",
},
},
},
})