diff options
| author | Phil A. J. W. <dscr@duck.com> | 2025-01-13 14:55:06 +0000 |
|---|---|---|
| committer | Phil A. J. W. <dscr@duck.com> | 2025-01-13 14:55:06 +0000 |
| commit | 5f71d25b9fd26b5eee7858e126a5d143e850fc02 (patch) | |
| tree | 241b20fa2f0cf2818bd6bdb06b4b99bfa7e90bcc /lua | |
| parent | 5bbacb3d11a62c7a665ee53bf4c09a5cc61acc2f (diff) | |
| parent | c233e93c2552940d228be7adb077da47ef42761f (diff) | |
| download | neovim-5f71d25b9fd26b5eee7858e126a5d143e850fc02.tar.gz neovim-5f71d25b9fd26b5eee7858e126a5d143e850fc02.zip | |
Merge pull request 'Update config' (#3) from test into master
Reviewed-on: https://codeberg.org/philw/nvim/pulls/3
Diffstat (limited to 'lua')
| -rw-r--r-- | lua/config/editor.lua | 86 | ||||
| -rw-r--r-- | lua/config/keymap.lua | 0 | ||||
| -rw-r--r-- | lua/config/lsp.lua | 64 | ||||
| -rw-r--r-- | lua/config/plugins.lua | 0 |
4 files changed, 0 insertions, 150 deletions
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 @@ | |||
| 1 | local option = vim.opt | ||
| 2 | local keymap = vim.keymap | ||
| 3 | |||
| 4 | --Basic Editor Setup | ||
| 5 | option.nu = true | ||
| 6 | option.tabstop = 2 | ||
| 7 | option.softtabstop = 2 | ||
| 8 | option.shiftwidth = 2 | ||
| 9 | option.expandtab = true | ||
| 10 | option.smartindent = true | ||
| 11 | option.wrap = false | ||
| 12 | option.swapfile = false | ||
| 13 | option.hlsearch = false | ||
| 14 | option.incsearch = true | ||
| 15 | option.updatetime = 50 | ||
| 16 | option.laststatus = 0 | ||
| 17 | option.signcolumn = "number" | ||
| 18 | option.autoindent = true | ||
| 19 | option.clipboard = "unnamedplus" | ||
| 20 | option.termguicolors = false | ||
| 21 | option.fillchars = 'eob: ' | ||
| 22 | |||
| 23 | -- Setup Editor Theme | ||
| 24 | vim.cmd([[ | ||
| 25 | highlight GitGutterAdd ctermbg=none | ||
| 26 | highlight GitGutterAdd guibg=none | ||
| 27 | highlight NonText guifg=none | ||
| 28 | highlight EndOfBuffer ctermfg=none ctermbg=none | ||
| 29 | highlight Normal ctermbg=none | ||
| 30 | highlight Normal guibg=none | ||
| 31 | highlight signcolumn ctermbg=none | ||
| 32 | highlight signcolumn guibg=none | ||
| 33 | highlight StatusLine ctermbg=none | ||
| 34 | highlight StatusLine guibg=none | ||
| 35 | highlight DiagnosticError ctermbg=none | ||
| 36 | highlight DiagnosticError guibg=none | ||
| 37 | highlight DiagnosticWarn ctermbg=none | ||
| 38 | highlight DiagnosticWarn guibg=none | ||
| 39 | highlight DiagnosticInfo ctermbg=none | ||
| 40 | highlight DiagnosticInfo guibg=none | ||
| 41 | highlight DiagnosticHint ctermbg=none | ||
| 42 | highlight DiagnosticHint guibg=none | ||
| 43 | |||
| 44 | highlight DiagnosticVirtualError ctermbg=none | ||
| 45 | highlight DiagnosticVirtualError guibg=none | ||
| 46 | highlight DiagnosticVirtualWarn ctermbg=none | ||
| 47 | highlight DiagnosticVirtualWarn guibg=none | ||
| 48 | highlight DiagnosticVirtualInfo ctermbg=none | ||
| 49 | highlight DiagnosticVirtualInfo guibg=none | ||
| 50 | highlight DiagnosticVirtualHint ctermbg=none | ||
| 51 | highlight DiagnosticVirtualHint guibg=none | ||
| 52 | |||
| 53 | highlight DiagnosticVirtualTextError ctermbg=none | ||
| 54 | highlight DiagnosticVirtualTextError guibg=none | ||
| 55 | highlight DiagnosticVirtualTextWarn ctermbg=none | ||
| 56 | highlight DiagnosticVirtualTextWarn guibg=none | ||
| 57 | highlight DiagnosticVirtualTextInfo ctermbg=none | ||
| 58 | highlight DiagnosticVirtualTextInfo guibg=none | ||
| 59 | highlight DiagnosticVirtualTextHint ctermbg=none | ||
| 60 | highlight DiagnosticVirtualTextHint guibg=none | ||
| 61 | ]]) | ||
| 62 | |||
| 63 | -- run specific commands after different file extensions | ||
| 64 | vim.cmd([[ | ||
| 65 | augroup RunPfOnSave | ||
| 66 | autocmd! | ||
| 67 | autocmd BufWritePost *.js,*.ts,*.jsx,*json,*.tsx,*.css,*.html,*.yaml,*.md silent! !prettier --write % | ||
| 68 | autocmd BufWritePost *.tex silent! :VimtexCompile | ||
| 69 | autocmd BufWritePost *.md silent! :MarkdownPreview | ||
| 70 | autocmd BufWritePost *.php silent! !php-cs-fixer fix % | ||
| 71 | augroup END | ||
| 72 | ]]) | ||
| 73 | |||
| 74 | -- Gui options | ||
| 75 | vim.o.guifont = "Fira Code:h7" | ||
| 76 | vim.g.vimtex_view_method = "zathura" | ||
| 77 | vim.g.vimtex_compiler_method = "latexrun" | ||
| 78 | vim.g.gitgutter_set_sign_backgrounds = 1 | ||
| 79 | |||
| 80 | --Keybinds | ||
| 81 | vim.g.mapleader = " " | ||
| 82 | keymap.set("n", "<leader>e", vim.cmd.Ex) | ||
| 83 | keymap.set("n", "<leader>s", [[:%s/\<<C-r><C-w>\>/<C-r><C-w>/gI<Left><Left><Left>]]) | ||
| 84 | keymap.set("n", "<leader>a", "ggVG") | ||
| 85 | keymap.set("v", "J", ":m '>+1<CR>gv=gv") | ||
| 86 | keymap.set("v", "K", ":m '<-2<CR>gv=gv") | ||
diff --git a/lua/config/keymap.lua b/lua/config/keymap.lua new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/lua/config/keymap.lua | |||
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 @@ | |||
| 1 | -- local lsp = require('lsp-zero') | ||
| 2 | |||
| 3 | --local lsp_zero = require("lsp-zero") | ||
| 4 | --local cmp = require("cmp") | ||
| 5 | --require("luasnip.loaders.from_vscode").lazy_load() | ||
| 6 | |||
| 7 | --lsp_zero.preset("recommended") | ||
| 8 | --lsp_zero.setup() | ||
| 9 | --lsp_zero.on_attach(function(client_id, bufnr) | ||
| 10 | -- lsp_zero.default_keymaps({ buffer = bufnr }) | ||
| 11 | --end) | ||
| 12 | |||
| 13 | --require("mason").setup({}) | ||
| 14 | --require("mason-lspconfig").setup({ | ||
| 15 | -- ensure_installed = { "clangd", "rust_analyzer" }, | ||
| 16 | -- handlers = { | ||
| 17 | -- lsp_zero.default_setup, | ||
| 18 | -- }, | ||
| 19 | --}) | ||
| 20 | |||
| 21 | --cmp.setup({ | ||
| 22 | -- snippet = { | ||
| 23 | -- expand = function(args) | ||
| 24 | -- require("luasnip").lsp_expand(args.body) | ||
| 25 | -- end, | ||
| 26 | -- }, | ||
| 27 | -- window = {}, | ||
| 28 | -- mapping = cmp.mapping.preset.insert({ | ||
| 29 | -- ["<C-b>"] = cmp.mapping.scroll_docs(-4), | ||
| 30 | -- ["<C-f>"] = cmp.mapping.scroll_docs(4), | ||
| 31 | -- ["<C-Space>"] = cmp.mapping.complete(), | ||
| 32 | -- ["<C-e>"] = cmp.mapping.abort(), | ||
| 33 | -- ["<CR>"] = cmp.mapping.confirm({ select = true }), -- Accept currently selected item. Set `select` to `false` to only confirm explicitly selected items. | ||
| 34 | -- }), | ||
| 35 | -- sources = cmp.config.sources({ | ||
| 36 | -- { name = "nvim_lsp" }, | ||
| 37 | -- { name = "luasnip" }, | ||
| 38 | -- }, { | ||
| 39 | -- { name = "buffer" }, | ||
| 40 | -- }), | ||
| 41 | --}) | ||
| 42 | |||
| 43 | --function PrintDiagnostics(opts, bufnr, line_nr, client_id) | ||
| 44 | -- bufnr = bufnr or 0 | ||
| 45 | -- line_nr = line_nr or (vim.api.nvim_win_get_cursor(0)[1] - 1) | ||
| 46 | -- opts = opts or { ["lnum"] = line_nr } | ||
| 47 | -- | ||
| 48 | -- local line_diagnostics = vim.diagnostic.get(bufnr, opts) | ||
| 49 | -- if vim.tbl_isempty(line_diagnostics) then | ||
| 50 | -- return | ||
| 51 | -- end | ||
| 52 | -- | ||
| 53 | -- local diagnostic_message = "" | ||
| 54 | -- for i, diagnostic in ipairs(line_diagnostics) do | ||
| 55 | -- diagnostic_message = diagnostic_message .. string.format("%d: %s", i, diagnostic.message or "") | ||
| 56 | -- print(diagnostic_message) | ||
| 57 | -- if i ~= #line_diagnostics then | ||
| 58 | -- diagnostic_message = diagnostic_message .. "\n" | ||
| 59 | -- end | ||
| 60 | -- end | ||
| 61 | -- vim.api.nvim_echo({ { diagnostic_message, "Normal" } }, false, {}) | ||
| 62 | --end | ||
| 63 | |||
| 64 | --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 --- /dev/null +++ b/lua/config/plugins.lua | |||
