From c233e93c2552940d228be7adb077da47ef42761f Mon Sep 17 00:00:00 2001 From: philw Date: Mon, 13 Jan 2025 15:52:11 +0100 Subject: Update config --- lua/config/editor.lua | 86 -------------------------------------------------- lua/config/keymap.lua | 0 lua/config/lsp.lua | 64 ------------------------------------- lua/config/plugins.lua | 0 4 files changed, 150 deletions(-) create mode 100644 lua/config/keymap.lua create mode 100644 lua/config/plugins.lua (limited to 'lua/config') diff --git a/lua/config/editor.lua b/lua/config/editor.lua index 0649006..e69de29 100644 --- a/lua/config/editor.lua +++ b/lua/config/editor.lua @@ -1,86 +0,0 @@ -local option = vim.opt -local keymap = vim.keymap - ---Basic Editor Setup -option.nu = true -option.tabstop = 2 -option.softtabstop = 2 -option.shiftwidth = 2 -option.expandtab = true -option.smartindent = true -option.wrap = false -option.swapfile = false -option.hlsearch = false -option.incsearch = true -option.updatetime = 50 -option.laststatus = 0 -option.signcolumn = "number" -option.autoindent = true -option.clipboard = "unnamedplus" -option.termguicolors = false -option.fillchars = 'eob: ' - --- Setup Editor Theme -vim.cmd([[ -highlight GitGutterAdd ctermbg=none -highlight GitGutterAdd guibg=none -highlight NonText guifg=none -highlight EndOfBuffer ctermfg=none ctermbg=none -highlight Normal ctermbg=none -highlight Normal guibg=none -highlight signcolumn ctermbg=none -highlight signcolumn guibg=none -highlight StatusLine ctermbg=none -highlight StatusLine guibg=none -highlight DiagnosticError ctermbg=none -highlight DiagnosticError guibg=none -highlight DiagnosticWarn ctermbg=none -highlight DiagnosticWarn guibg=none -highlight DiagnosticInfo ctermbg=none -highlight DiagnosticInfo guibg=none -highlight DiagnosticHint ctermbg=none -highlight DiagnosticHint guibg=none - -highlight DiagnosticVirtualError ctermbg=none -highlight DiagnosticVirtualError guibg=none -highlight DiagnosticVirtualWarn ctermbg=none -highlight DiagnosticVirtualWarn guibg=none -highlight DiagnosticVirtualInfo ctermbg=none -highlight DiagnosticVirtualInfo guibg=none -highlight DiagnosticVirtualHint ctermbg=none -highlight DiagnosticVirtualHint guibg=none - -highlight DiagnosticVirtualTextError ctermbg=none -highlight DiagnosticVirtualTextError guibg=none -highlight DiagnosticVirtualTextWarn ctermbg=none -highlight DiagnosticVirtualTextWarn guibg=none -highlight DiagnosticVirtualTextInfo ctermbg=none -highlight DiagnosticVirtualTextInfo guibg=none -highlight DiagnosticVirtualTextHint ctermbg=none -highlight DiagnosticVirtualTextHint guibg=none -]]) - --- run specific commands after different file extensions -vim.cmd([[ -augroup RunPfOnSave -autocmd! -autocmd BufWritePost *.js,*.ts,*.jsx,*json,*.tsx,*.css,*.html,*.yaml,*.md silent! !prettier --write % -autocmd BufWritePost *.tex silent! :VimtexCompile -autocmd BufWritePost *.md silent! :MarkdownPreview -autocmd BufWritePost *.php silent! !php-cs-fixer fix % -augroup END -]]) - --- Gui options -vim.o.guifont = "Fira Code:h7" -vim.g.vimtex_view_method = "zathura" -vim.g.vimtex_compiler_method = "latexrun" -vim.g.gitgutter_set_sign_backgrounds = 1 - ---Keybinds -vim.g.mapleader = " " -keymap.set("n", "e", vim.cmd.Ex) -keymap.set("n", "s", [[:%s/\<\>//gI]]) -keymap.set("n", "a", "ggVG") -keymap.set("v", "J", ":m '>+1gv=gv") -keymap.set("v", "K", ":m '<-2gv=gv") diff --git a/lua/config/keymap.lua b/lua/config/keymap.lua new file mode 100644 index 0000000..e69de29 diff --git a/lua/config/lsp.lua b/lua/config/lsp.lua index 7fd0ddb..e69de29 100644 --- a/lua/config/lsp.lua +++ b/lua/config/lsp.lua @@ -1,64 +0,0 @@ --- local lsp = require('lsp-zero') - ---local lsp_zero = require("lsp-zero") ---local cmp = require("cmp") ---require("luasnip.loaders.from_vscode").lazy_load() - ---lsp_zero.preset("recommended") ---lsp_zero.setup() ---lsp_zero.on_attach(function(client_id, bufnr) --- lsp_zero.default_keymaps({ buffer = bufnr }) ---end) - ---require("mason").setup({}) ---require("mason-lspconfig").setup({ --- ensure_installed = { "clangd", "rust_analyzer" }, --- handlers = { --- lsp_zero.default_setup, --- }, ---}) - ---cmp.setup({ --- snippet = { --- expand = function(args) --- require("luasnip").lsp_expand(args.body) --- end, --- }, --- window = {}, --- mapping = cmp.mapping.preset.insert({ --- [""] = cmp.mapping.scroll_docs(-4), --- [""] = cmp.mapping.scroll_docs(4), --- [""] = cmp.mapping.complete(), --- [""] = cmp.mapping.abort(), --- [""] = cmp.mapping.confirm({ select = true }), -- Accept currently selected item. Set `select` to `false` to only confirm explicitly selected items. --- }), --- sources = cmp.config.sources({ --- { name = "nvim_lsp" }, --- { name = "luasnip" }, --- }, { --- { name = "buffer" }, --- }), ---}) - ---function PrintDiagnostics(opts, bufnr, line_nr, client_id) --- bufnr = bufnr or 0 --- line_nr = line_nr or (vim.api.nvim_win_get_cursor(0)[1] - 1) --- opts = opts or { ["lnum"] = line_nr } --- --- local line_diagnostics = vim.diagnostic.get(bufnr, opts) --- if vim.tbl_isempty(line_diagnostics) then --- return --- end --- --- local diagnostic_message = "" --- for i, diagnostic in ipairs(line_diagnostics) do --- diagnostic_message = diagnostic_message .. string.format("%d: %s", i, diagnostic.message or "") --- print(diagnostic_message) --- if i ~= #line_diagnostics then --- diagnostic_message = diagnostic_message .. "\n" --- end --- end --- vim.api.nvim_echo({ { diagnostic_message, "Normal" } }, false, {}) ---end - ---vim.cmd([[ autocmd! CursorHold * lua PrintDiagnostics() ]]) diff --git a/lua/config/plugins.lua b/lua/config/plugins.lua new file mode 100644 index 0000000..e69de29 -- cgit v1.2.3