From e61788a4456be7290a9cf48c7dd2b9db1b8e6e57 Mon Sep 17 00:00:00 2001 From: nova Date: Sat, 28 Mar 2026 17:09:17 +0100 Subject: [PATCH] changes --- init.lua | 14 ++++++-- lua/config/bindings.lua | 22 ++++++------ lua/config/coq.lua | 21 ----------- lua/config/lsp.lua | 65 +++++++++++++++++++++++++++++++++ lua/plugins.lua | 31 ---------------- lua/ui/highlight.lua | 79 +++-------------------------------------- lua/ui/startscreen.lua | 36 ------------------- 7 files changed, 92 insertions(+), 176 deletions(-) delete mode 100644 lua/config/coq.lua create mode 100644 lua/config/lsp.lua delete mode 100644 lua/ui/startscreen.lua diff --git a/init.lua b/init.lua index e372c59..a687a3a 100644 --- a/init.lua +++ b/init.lua @@ -1,10 +1,9 @@ require("bootstrap") require("plugins") -require("config.coq") +require("config.lsp") require("config.winsep") require("config.bindings") require("ui.status") -require("ui.startscreen") require("ui.highlight") --{{{ vim cmd @@ -17,4 +16,13 @@ vim.cmd(":set relativenumber") vim.cmd(":set foldmethod=marker") vim.opt.fillchars:append { eob = " " } --}}} -vim.g.vimtex_view_method = 'zathura' + +vim.g.rust_recommended_style = '0' --why the fuck does a fucking _editor_ believe it has the right to overwrite MY settings? + --like i just wanted to fuck around with this language once, so why do i have to tell the editor + --to respect the settings i have already set? + --um aktsthually the user doesnt know what they want, better have them jump through this shitty hoop. + --or is it that you believe the user is incorrect? + --so trying this language once means i have to keep this shit smear in my configs at all times? + --is rust the only language or do i have to check every single language i may ever interact? + --do i have try out every feature to make sure youre not dismissing my decissions? + --who shat in your brain diff --git a/lua/config/bindings.lua b/lua/config/bindings.lua index c3ef3b0..95f99cc 100644 --- a/lua/config/bindings.lua +++ b/lua/config/bindings.lua @@ -1,15 +1,15 @@ --tab navigation -vim.keymap.set("n", "", "1gt") -vim.keymap.set("n", "", "2gt") -vim.keymap.set("n", "", "3gt") -vim.keymap.set("n", "", "4gt") -vim.keymap.set("n", "", "5gt") -vim.keymap.set("n", "", "6gt") -vim.keymap.set("n", "", "7gt") -vim.keymap.set("n", "", "8gt") -vim.keymap.set("n", "", "9gt") -vim.keymap.set("n", "", ":tablast") -vim.keymap.set("n", "", ":tab new") +vim.keymap.set("n", "1", "1gt") +vim.keymap.set("n", "2", "2gt") +vim.keymap.set("n", "3", "3gt") +vim.keymap.set("n", "4", "4gt") +vim.keymap.set("n", "5", "5gt") +vim.keymap.set("n", "6", "6gt") +vim.keymap.set("n", "7", "7gt") +vim.keymap.set("n", "8", "8gt") +vim.keymap.set("n", "9", "9gt") +vim.keymap.set("n", "0", ":tablast") +vim.keymap.set("n", "", ":tab new") --move between splits with hjkl vim.keymap.set("n", "", ":wincmd l") vim.keymap.set("n", "", ":wincmd k") diff --git a/lua/config/coq.lua b/lua/config/coq.lua deleted file mode 100644 index 00f4b5e..0000000 --- a/lua/config/coq.lua +++ /dev/null @@ -1,21 +0,0 @@ -local lsp = require "lspconfig" -local coq = require "coq" -require("mason").setup() -require("mason-lspconfig").setup() - -lsp.clangd.setup(coq.lsp_ensure_capabilities({ - on_attach = on_attach, - capabilities = capabilities, -})) -lsp.rust_analyzer.setup(coq.lsp_ensure_capabilities({ - on_attach = on_attach, - capabilities = capabilities, -})) -lsp.lua_ls.setup(coq.lsp_ensure_capabilities({ - on_attach = on_attach, - capabilities = capabilities, -})) -lsp.arduino_language_server.setup(coq.lsp_ensure_capabilities({ - on_attach = on_attach, - capabilities = capabilities, -})) diff --git a/lua/config/lsp.lua b/lua/config/lsp.lua new file mode 100644 index 0000000..dccd53b --- /dev/null +++ b/lua/config/lsp.lua @@ -0,0 +1,65 @@ +vim.opt.completeopt = { "menuone", "noselect", "popup" } +vim.lsp.config['lua_ls'] = { + -- Command and arguments to start the server. + cmd = { 'lua-language-server' }, + -- Filetypes to automatically attach to. + filetypes = { 'lua' }, + -- Sets the "workspace" to the directory where any of these files is found. + -- Files that share a root directory will reuse the LSP server connection. + -- Nested lists indicate equal priority, see |vim.lsp.Config|. + root_markers = { { '.luarc.json', '.luarc.jsonc' }, '.git' }, + -- Specific settings to send to the server. The schema is server-defined. + -- Example: https://raw.githubusercontent.com/LuaLS/vscode-lua/master/setting/schema.json + settings = { + Lua = { + runtime = { + version = 'LuaJIT', + } + } + } +} +vim.lsp.config['clangd'] = { + cmd = { 'clangd' }, + filetypes = { 'c', 'cpp', 'objc', 'objcpp', 'cuda' }, + root_markers = { + --'.clangd', + --'.clang-tidy', + --'.clang-format', + --'compile_commands.json', + --'compile_flags.txt', + --'configure.ac', -- AutoTools + '.git', + }, + capabilities = { + textDocument = { + completion = { + editsNearCursor = true, + }, + }, + offsetEncoding = { 'utf-8', 'utf-16' }, + }, + vim.keymap.set("i", "", vim.lsp.completion.get, { desc = "trigger autocompletion" }) + +} +vim.lsp.enable('lua_ls') +vim.lsp.enable('clangd') + +vim.api.nvim_create_autocmd('LspAttach', { + group = vim.api.nvim_create_augroup('my.lsp', {}), + callback = function(args) + local client = assert(vim.lsp.get_client_by_id(args.data.client_id)) + -- Enable auto-completion. Note: Use CTRL-Y to select an item. |complete_CTRL-Y| + if client:supports_method('textDocument/completion') then + -- Optional: trigger autocompletion on EVERY keypress. May be slow! + local chars = {}; for i = 32, 126 do table.insert(chars, string.char(i)) end + client.server_capabilities.completionProvider.triggerCharacters = chars + vim.lsp.completion.enable(true, client.id, args.buf, {autotrigger = true}) + end + end, +}) + +-- open autocomplete menu when pressing +vim.keymap.set('i', '', function() + vim.lsp.completion.get() +end) + diff --git a/lua/plugins.lua b/lua/plugins.lua index c48475f..42b8b70 100644 --- a/lua/plugins.lua +++ b/lua/plugins.lua @@ -3,31 +3,6 @@ local plugins = { -- {{{ basic lsp stuff { "neovim/nvim-lspconfig", - event = "VeryLazy", - }, - { - "williamboman/mason-lspconfig.nvim", - event = "VeryLazy", - dependencies = { - "williamboman/mason.nvim" - } - - }, - { - 'ms-jpq/coq_nvim', - branch = 'coq', - event = "InsertEnter", - init = function() vim.g.coq_settings = { - auto_start = 'shut-up', - ["keymap.jump_to_mark"] = "", - ["display.ghost_text.enabled"] = false, - } end, - dependencies = { - { "ms-jpq/coq.artifacts", - branch = "artifacts", - event = "InsertEnter", }, - { "neovim/nvim-lspconfig" }, - }, }, -- }}} -- }}} @@ -68,12 +43,6 @@ local plugins = { end }, - --start screen - { - 'nvimdev/dashboard-nvim', - event = 'VimEnter', - dependencies = { {'nvim-tree/nvim-web-devicons'}} - }, -- }}} -- {{{ misc diff --git a/lua/ui/highlight.lua b/lua/ui/highlight.lua index f34f577..2fa159c 100644 --- a/lua/ui/highlight.lua +++ b/lua/ui/highlight.lua @@ -68,11 +68,15 @@ hi! link Question MoreMsg hi! link ModeMsg MoreMsg hi! link TabLineFill StatusLineNC hi! link SpecialKey NonText +"hi! link @lsp.type.comment.cpp NONE "inside of #define blocks for conditional compilation "}}} " Generic syntax {{{ hi Delimiter ctermfg=7 hi Comment ctermfg=8 +hi @lsp.type.comment.cpp ctermbg=16 "inside of #define blocks for conditional compilation +hi @lsp.type.comment.c ctermbg=16 +hi cBlock ctermbg=2 hi Underlined ctermfg=4 cterm=underline hi Type ctermfg=4 hi String ctermfg=11 @@ -86,7 +90,7 @@ hi Number ctermfg=12 hi Boolean ctermfg=4 hi Special ctermfg=13 hi Ignore ctermfg=0 -hi PreProc ctermfg=8 cterm=bold +hi PreProc ctermbg=16 hi! link Operator Delimiter hi! link Error ErrorMsg @@ -106,29 +110,6 @@ hi htmlBoldUnderlineItalic cterm=bold,underline hi! link htmlLink Underlined hi! link htmlEndTag htmlTag -"}}} -" XML {{{ -hi xmlTagName ctermfg=4 -hi xmlTag ctermfg=12 -hi! link xmlString xmlTagName -hi! link xmlAttrib xmlTag -hi! link xmlEndTag xmlTag -hi! link xmlEqual xmlTag - -"}}} -" JavaScript {{{ -hi! link javaScript Normal -hi! link javaScriptBraces Delimiter - -"}}} -" PHP {{{ -hi phpSpecialFunction ctermfg=5 -hi phpIdentifier ctermfg=11 -hi phpParent ctermfg=8 -hi! link phpVarSelector phpIdentifier -hi! link phpHereDoc String -hi! link phpDefine Statement - "}}} " Markdown {{{ hi! link markdownHeadingRule NonText @@ -144,14 +125,6 @@ hi markdownCode cterm=bold hi markdownBold cterm=bold hi markdownItalic cterm=underline -"}}} -" Ruby {{{ -hi! link rubyDefine Statement -hi! link rubyLocalVariableOrMethod Identifier -hi! link rubyConstant Constant -hi! link rubyInstanceVariable Number -hi! link rubyStringDelimiter rubyString - "}}} " Git {{{ hi gitCommitBranch ctermfg=3 @@ -170,23 +143,6 @@ hi! link vimSetSep Delimiter hi! link vimContinue Delimiter hi! link vimHiAttrib Constant -"}}} -" LESS {{{ -hi lessVariable ctermfg=11 -hi! link lessVariableValue Normal - -"}}} -" NERDTree {{{ -hi! link NERDTreeHelp Comment -hi! link NERDTreeExecFile String - -"}}} -" Vimwiki {{{ -hi! link VimwikiHeaderChar markdownHeadingDelimiter -hi! link VimwikiList markdownListMarker -hi! link VimwikiCode markdownCode -hi! link VimwikiCodeChar markdownCodeDelimiter - "}}} " Help {{{ hi! link helpExample String @@ -201,14 +157,6 @@ hi! link helpURL Underlined hi! link CtrlPMatch String hi! link CtrlPLinePre Comment -"}}} -" Mustache {{{ -hi mustacheSection ctermfg=14 cterm=bold -hi mustacheMarker ctermfg=6 -hi mustacheVariable ctermfg=14 -hi mustacheVariableUnescape ctermfg=9 -hi mustachePartial ctermfg=13 - "}}} " Shell {{{ hi shDerefSimple ctermfg=11 @@ -221,17 +169,6 @@ hi SyntasticErrorSign ctermfg=1 ctermbg=NONE hi SyntasticStyleWarningSign ctermfg=2 ctermbg=NONE hi SyntasticStyleErrorSign ctermfg=4 ctermbg=NONE -"}}} -" Netrw {{{ -hi netrwExe ctermfg=9 -hi netrwClassify ctermfg=8 cterm=bold - -"}}} -" Ledger {{{ -hi ledgerAccount ctermfg=11 -hi! link ledgerMetadata Comment -hi! link ledgerTransactionStatus Statement - "}}} " Diff {{{ hi diffAdded ctermfg=2 @@ -243,12 +180,6 @@ hi! link diffLine Title " Plug {{{ hi plugSha ctermfg=3 -"}}} -" Blade {{{ -hi! link bladeStructure PreProc -hi! link bladeParen phpParent -hi! link bladeEchoDelim PreProc - "}}} " vim: fdm=marker:sw=2:sts=2:et diff --git a/lua/ui/startscreen.lua b/lua/ui/startscreen.lua deleted file mode 100644 index 7c01343..0000000 --- a/lua/ui/startscreen.lua +++ /dev/null @@ -1,36 +0,0 @@ -local dash = require('dashboard') -local custom_header = { - ' .█▄╥ _▄K¥▄ ', - ' █ `▀▄_ ▄▄ ╓▄▀" ▀▌ ', - ' █ "▀▄, ▓ ▀▀▄ ▄▀- █ ', - ' ▐▌ ▀▄▌▀▀▀▀`""▀▀█ ▀▄ _▄▀ ▓ ', - ' ▓ "▓╥ "▓_.▓▀ ╫ ', - ' )▌ ▀█ ╫ ', - ' ▐∩ █ ', - ' ▐∩ ▐▌ ', - ' ▐µ █▌ ', - ' ▓ ╨▓▓█▄▄╥_ ,▄▄█████▄ █ ', - ' ▐▄ `"▀▀██▄ ▐███▌╓_ .▓" ', - ' "▓▄ _▄▄███▀` ▄▄▄▄┐ "▀▀█████▄ .▄K▀▀▀▀█ ', - '▐▌▀▀▀▀ª ▀▀` "▀▄, _ _╥▄▀ ', - ' ▓▄ _╥µ __ ,▄▄ ]µ ` ╫▌@╨ ▀▌ ', - ' "▀▄` ▓K" *▌▄▄▀" "▀▀▓▀ ▀▄ ', - ' █. ▐▌ j▌ _ █ ', - ' █ , ▀▄ ▐▌ ▄▓"▀▀▀▀" ', - ' ▐█K▀▀"▀¥██▌▄▄_ ╨▓_ _█ ,▄▄K▀▀ ', - ' ▐▌ "▀W "▀" "█µ ', - ' ▐█ "▓_ ', - ' _▓▀ ▀▄ ', - ' j█____ _ ▀▄ ', - ' ``"▓" ▓⌐ ', - ' █ ▐▌ ', - ' ▀ ▀ ', -} - - -dash.setup{ - config = { - theme = 'doom', - header = custom_header, - } -}