From 41682275d321b6b79ee4c07f25e819875519466e Mon Sep 17 00:00:00 2001 From: joe Date: Mon, 25 Aug 2025 18:13:21 +0200 Subject: cool --- .config/nvim/after/plugin/gitsigns.lua | 39 ---- .config/nvim/after/plugin/gruvbox.lua | 29 --- .config/nvim/after/plugin/kanagawa.lua | 27 --- .config/nvim/after/plugin/lsp.lua | 229 -------------------- .config/nvim/after/plugin/lualine.lua | 349 ------------------------------- .config/nvim/after/plugin/rainbow.lua | 23 -- .config/nvim/after/plugin/telescope.lua | 16 -- .config/nvim/after/plugin/treesitter.lua | 42 ---- .config/nvim/after/plugin/trouble.lua | 17 -- .config/nvim/init.lua | 15 +- .config/nvim/lua/bindings.lua | 68 ------ .config/nvim/lua/config/bindings.lua | 69 ++++++ .config/nvim/lua/config/hooks.lua | 8 + .config/nvim/lua/config/langs.lua | 11 + .config/nvim/lua/config/lazy.lua | 117 +++++++++++ .config/nvim/lua/config/settings.lua | 93 ++++++++ .config/nvim/lua/hooks.lua | 8 - .config/nvim/lua/langs.lua | 11 - .config/nvim/lua/lsp/arduino.lua | 13 ++ .config/nvim/lua/lsp/clangd.lua | 11 + .config/nvim/lua/lsp/gopls.lua | 25 +++ .config/nvim/lua/lsp/luals.lua | 7 + .config/nvim/lua/lsp/perlnavigator.lua | 16 ++ .config/nvim/lua/packs.lua | 171 --------------- .config/nvim/lua/plugins/gruvbox.lua | 38 ++++ .config/nvim/lua/plugins/lspkind.lua | 102 +++++++++ .config/nvim/lua/plugins/lualine.lua | 298 ++++++++++++++++++++++++++ .config/nvim/lua/plugins/rainbow.lua | 28 +++ .config/nvim/lua/plugins/telescope.lua | 25 +++ .config/nvim/lua/plugins/treesitter.lua | 53 +++++ .config/nvim/lua/plugins/trouble.lua | 27 +++ .config/nvim/lua/settings.lua | 93 -------- 32 files changed, 951 insertions(+), 1127 deletions(-) delete mode 100644 .config/nvim/after/plugin/gitsigns.lua delete mode 100644 .config/nvim/after/plugin/gruvbox.lua delete mode 100644 .config/nvim/after/plugin/kanagawa.lua delete mode 100644 .config/nvim/after/plugin/lsp.lua delete mode 100644 .config/nvim/after/plugin/lualine.lua delete mode 100644 .config/nvim/after/plugin/rainbow.lua delete mode 100644 .config/nvim/after/plugin/telescope.lua delete mode 100644 .config/nvim/after/plugin/treesitter.lua delete mode 100644 .config/nvim/after/plugin/trouble.lua delete mode 100644 .config/nvim/lua/bindings.lua create mode 100644 .config/nvim/lua/config/bindings.lua create mode 100644 .config/nvim/lua/config/hooks.lua create mode 100644 .config/nvim/lua/config/langs.lua create mode 100644 .config/nvim/lua/config/lazy.lua create mode 100644 .config/nvim/lua/config/settings.lua delete mode 100644 .config/nvim/lua/hooks.lua delete mode 100644 .config/nvim/lua/langs.lua create mode 100644 .config/nvim/lua/lsp/arduino.lua create mode 100644 .config/nvim/lua/lsp/clangd.lua create mode 100644 .config/nvim/lua/lsp/gopls.lua create mode 100644 .config/nvim/lua/lsp/luals.lua create mode 100644 .config/nvim/lua/lsp/perlnavigator.lua delete mode 100644 .config/nvim/lua/packs.lua create mode 100644 .config/nvim/lua/plugins/gruvbox.lua create mode 100644 .config/nvim/lua/plugins/lspkind.lua create mode 100644 .config/nvim/lua/plugins/lualine.lua create mode 100644 .config/nvim/lua/plugins/rainbow.lua create mode 100644 .config/nvim/lua/plugins/telescope.lua create mode 100644 .config/nvim/lua/plugins/treesitter.lua create mode 100644 .config/nvim/lua/plugins/trouble.lua delete mode 100644 .config/nvim/lua/settings.lua diff --git a/.config/nvim/after/plugin/gitsigns.lua b/.config/nvim/after/plugin/gitsigns.lua deleted file mode 100644 index 7b4d6a2..0000000 --- a/.config/nvim/after/plugin/gitsigns.lua +++ /dev/null @@ -1,39 +0,0 @@ -require('gitsigns').setup { - signs = { - add = { text = '│' }, - change = { text = '┆' }, - delete = { text = '_' }, - topdelete = { text = '‾' }, - changedelete = { text = '~' }, - untracked = { text = '┆' }, - }, - signcolumn = true, -- Toggle with `:Gitsigns toggle_signs` - numhl = false, -- Toggle with `:Gitsigns toggle_numhl` - linehl = false, -- Toggle with `:Gitsigns toggle_linehl` - word_diff = false, -- Toggle with `:Gitsigns toggle_word_diff` - watch_gitdir = { - follow_files = true - }, - attach_to_untracked = true, - current_line_blame = false, -- Toggle with `:Gitsigns toggle_current_line_blame` - current_line_blame_opts = { - virt_text = true, - virt_text_pos = 'eol', -- 'eol' | 'overlay' | 'right_align' - delay = 1000, - ignore_whitespace = false, - virt_text_priority = 100, - }, - current_line_blame_formatter = ', - ', - sign_priority = 6, - update_debounce = 100, - status_formatter = nil, -- Use default - max_file_length = 40000, -- Disable if file is longer than this (in lines) - preview_config = { - -- Options passed to nvim_open_win - border = 'single', - style = 'minimal', - relative = 'cursor', - row = 0, - col = 1 - }, -} diff --git a/.config/nvim/after/plugin/gruvbox.lua b/.config/nvim/after/plugin/gruvbox.lua deleted file mode 100644 index 7ea4f3e..0000000 --- a/.config/nvim/after/plugin/gruvbox.lua +++ /dev/null @@ -1,29 +0,0 @@ -require("gruvbox").setup({ - priority = 1000, - terminal_colors = false, -- add neovim terminal colors - undercurl = true, - underline = true, - bold = false, - italic = { - strings = false, - emphasis = true, - comments = true, - operators = false, - folds = true, - }, - strikethrough = true, - invert_selection = false, - invert_signs = false, - invert_tabline = false, - invert_intend_guides = false, - inverse = true, -- invert background for search, diffs, statuslines and errors - contrast = "", -- can be "hard", "soft" or empty string - palette_overrides = {}, - overrides = { - ["@punctuation.delimiter"] = { fg = "#928374" }, - ["@string"] = { fg = "#8ec07c" }, - }, - dim_inactive = false, - transparent_mode = true, -}) -vim.cmd("colorscheme gruvbox") diff --git a/.config/nvim/after/plugin/kanagawa.lua b/.config/nvim/after/plugin/kanagawa.lua deleted file mode 100644 index 4eb498f..0000000 --- a/.config/nvim/after/plugin/kanagawa.lua +++ /dev/null @@ -1,27 +0,0 @@ --- require('kanagawa').setup({ --- compile = true, -- enable compiling the colorscheme --- undercurl = true, -- enable undercurls --- commentStyle = { italic = true }, --- functionStyle = {}, --- keywordStyle = { italic = true, bold = false }, --- statementStyle = { bold = false }, --- typeStyle = {}, --- transparent = true, -- do not set background color --- dimInactive = false, -- dim inactive window `:h hl-NormalNC` --- terminalColors = false, -- define vim.g.terminal_color_{0,17} --- colors = { -- add/modify theme and palette colors --- palette = {}, --- theme = { wave = {}, lotus = {}, dragon = {}, all = {} }, --- }, --- overrides = function(colors) -- add/modify highlights --- return {} --- end, --- theme = "dragon", -- Load "wave" theme when 'background' option is not set --- background = { -- map the value of 'background' option to a theme --- dark = "dragon", -- try "dragon" ! --- light = "lotus" --- }, --- }) - --- setup must be called before loading --- vim.cmd("colorscheme kanagawa") diff --git a/.config/nvim/after/plugin/lsp.lua b/.config/nvim/after/plugin/lsp.lua deleted file mode 100644 index a0e2316..0000000 --- a/.config/nvim/after/plugin/lsp.lua +++ /dev/null @@ -1,229 +0,0 @@ -local lsp = require('lsp-zero') - -lsp.preset('recommended') - -lsp.on_attach(function(client, bufnr) - local opts = { buffer = bufnr, remap = false } - - vim.keymap.set('n', 'gd', function() vim.lsp.buf.definition() end, opts) - vim.keymap.set('n', 'K', function() vim.lsp.buf.hover() end, opts) - vim.keymap.set('n', 'vws', function() vim.lsp.buf.workspace_symbol() end, opts) - vim.keymap.set('n', 'vd', function() vim.diagnostic.open_float() end, opts) - vim.keymap.set('n', '[d', function() vim.diagnostic.goto_prev() end, opts) - vim.keymap.set('n', ']d', function() vim.diagnostic.goto_next() end, opts) - vim.keymap.set('n', 'vca', function() vim.lsp.buf.code_actions() end, opts) - vim.keymap.set('n', 'vrr', function() vim.lsp.buf.references() end, opts) - vim.keymap.set('n', 'vrn', function() vim.lsp.buf.rename() end, opts) - vim.keymap.set('i', '', function() vim.lsp.buf.signature_help() end, opts) -end) - -require('mason').setup({ - servers = { - 'clangd', - }, -}) - - -require('mason-lspconfig').setup({ - ensure_installed = { - 'eslint', - 'rust_analyzer', - 'lua_ls', - 'gopls', - 'arduino_language_server', - 'bashls', - 'perlnavigator', - 'clangd', - 'yamlls', - }, - handlers = { - lsp.default_setup, - }, -}) - --- langs - -require('lspconfig').gopls.setup({ - settings = { - gopls = { - analyses = { - unreachable = true, - unusedparams = true, - }, - codelenses = { - generate = true, - gc_details = true, - }, - annotations = { - bounds = true, - escape = true, - inline = true, - }, - gofumpt = true, - }, - }, -}) - -require('lspconfig').clangd.setup({ - settings = { - clangd = { - mason = false, - }, - }, -}) - -require'lspconfig'.perlnavigator.setup{ - cmd = { "perlnavigator" }, - settings = { - perlnavigator = { - perlPath = 'perl', - enableWarnings = true, - perltidyProfile = '', - perlcriticProfile = '', - perlcriticEnabled = true, - } - } -} - -require('lspconfig').arduino_language_server.setup({ - cmd = { - "arduino-language-server", - "-cli-config", "/home/jozan/.arduino15/arduino-cli.yaml", - "-cli", "arduino-cli", - "-clangd", "clangd", - "-fqbn", "esp32:esp32:esp32", - } -}) - -require'lspconfig'.terraformls.setup{} -vim.api.nvim_create_autocmd({"BufWritePre"}, { - pattern = {"*.tf", "*.tfvars"}, - callback = function() - vim.lsp.buf.format() - end, -}) - --- cmp - -local cmp = require('cmp') -local cmp_select = { behavior = cmp.SelectBehavior.Select } -cmp.setup({ - window = { - -- completion = cmp.config.window.bordered(), - -- documentation = cmp.config.window.bordered(), - }, - mapping = cmp.mapping.preset.insert({ - [''] = cmp.mapping.select_next_item(cmp_select), - [''] = cmp.mapping.select_prev_item(cmp_select), - [''] = 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. - [''] = 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 = 'vsnip' }, -- For vsnip users. - -- { name = 'luasnip' }, -- For luasnip users. - -- { name = 'ultisnips' }, -- For ultisnips users. - -- { name = 'snippy' }, -- For snippy users. - }, { - { name = 'buffer' }, - }) -}) - - -- Set configuration for specific filetype. - cmp.setup.filetype('gitcommit', { - sources = cmp.config.sources({ - { name = 'git' }, -- You can specify the `git` source if [you were installed it](https://github.com/petertriho/cmp-git). - }, { - { name = 'buffer' }, - }) - }) - - -- Use buffer source for `/` and `?` (if you enabled `native_menu`, this won't work anymore). - cmp.setup.cmdline({ '/', '?' }, { - mapping = cmp.mapping.preset.cmdline(), - sources = { - { name = 'buffer' } - } - }) - - -- Use cmdline & path source for ':' (if you enabled `native_menu`, this won't work anymore). - cmp.setup.cmdline(':', { - mapping = cmp.mapping.preset.cmdline(), - sources = cmp.config.sources({ - { name = 'path' } - }, { - { name = 'cmdline' } - }) - }) - -local cmp_mappings = lsp.defaults.cmp_mappings({ -}) - - -lsp.set_preferences({ --- sign_icons = { } - sign_icons = { - Text = "󰉿", - Method = "󰆧", - Function = "󰊕", - Constructor = "", - Field = "󰜢", - Variable = "󰀫", - Class = "󰠱", - Interface = "", - Module = "", - Property = "󰜢", - Unit = "󰑭", - Value = "󰎠", - Enum = "", - Keyword = "󰌋", - Snippet = "", - Color = "󰏘", - File = "󰈙", - Reference = "󰈇", - Folder = "󰉋", - EnumMember = "", - Constant = "󰏿", - Struct = "󰙅", - Event = "", - Operator = "󰆕", - TypeParameter = "", - }, -}) - -local lspkind = require('lspkind') -cmp.setup { - - formatting = { - format = lspkind.cmp_format({ - mode = 'symbol', -- show only symbol annotations - maxwidth = 50, -- prevent the popup from showing more than provided characters (e.g 50 will not show more than 50 characters) - ellipsis_char = '...', -- when popup menu exceed maxwidth, the truncated part would show ellipsis_char instead (must define maxwidth first) - - -- The function below will be called before any actual modifications from lspkind - -- so that you can provide more controls on popup customization. (See [#30](https://github.com/onsails/lspkind-nvim/pull/30)) - before = function (entry, vim_item) - return vim_item - end - }) - } -} - --- local lspconfig = require'lspconfig' --- lspconfig.ccls.setup { --- init_options = { --- compilationDatabaseDirectory = "build"; --- index = { --- threads = 0; --- }; --- clang = { --- excludeArgs = { "-frounding-math" }; --- }; --- } --- } - -lsp.setup() diff --git a/.config/nvim/after/plugin/lualine.lua b/.config/nvim/after/plugin/lualine.lua deleted file mode 100644 index 7f94ccd..0000000 --- a/.config/nvim/after/plugin/lualine.lua +++ /dev/null @@ -1,349 +0,0 @@ --- Eviline config for lualine --- Author: shadmansaleh --- Credit: glepnir -local lualine = require('lualine') - --- Color table for highlights --- stylua: ignore -local colors = { - bg = '#202328', - fg = '#a89984', - yellow = '#ecbe7b', - cyan = '#008080', - darkblue = '#081633', - green = '#98be65', - orange = '#ff8800', - violet = '#a9a1e1', - magenta = '#c678dd', - blue = '#51afef', - red = '#ec5f67', -} - -local conditions = { - buffer_not_empty = function() - return vim.fn.empty(vim.fn.expand('%:t')) ~= 1 - end, - hide_in_width = function() - return vim.fn.winwidth(0) > 80 - end, - check_git_workspace = function() - local filepath = vim.fn.expand('%:p:h') - local gitdir = vim.fn.finddir('.git', filepath .. ';') - return gitdir and #gitdir > 0 and #gitdir < #filepath - end, -} - --- Config -local config = { - options = { - -- Disable sections and component separators - component_separators = '', - section_separators = '', - theme = { - -- We are going to use lualine_c an lualine_x as left and - -- right section. Both are highlighted by c theme . So we - -- are just setting default looks o statusline - normal = { c = { fg = colors.fg, bg = colors.bg } }, - inactive = { c = { fg = colors.fg, bg = colors.bg } }, - }, - }, - sections = { - -- these are to remove the defaults - lualine_a = {}, - lualine_b = {}, - lualine_y = {}, - lualine_z = {}, - -- These will be filled later - lualine_c = {}, - lualine_x = {}, - }, - inactive_sections = { - -- these are to remove the defaults - lualine_a = {}, - lualine_b = {}, - lualine_y = {}, - lualine_z = {}, - lualine_c = {}, - lualine_x = {}, - }, -} - --- Inserts a component in lualine_c at left section -local function ins_left(component) - table.insert(config.sections.lualine_c, component) -end - --- Inserts a component in lualine_x at right section -local function ins_right(component) - table.insert(config.sections.lualine_x, component) -end - -ins_left { - function() - return '▊' - end, - -- color = { fg = colors.green }, -- Sets highlighting of component - color = function() - -- auto change color according to neovims mode - local mode_color = { - n = colors.green, - i = colors.blue, - v = colors.magenta, - [''] = colors.magenta, - V = colors.magenta, - c = colors.yellow, - no = colors.red, - s = colors.orange, - S = colors.orange, - [''] = colors.orange, - ic = colors.yellow, - R = colors.red, - Rv = colors.violet, - cv = colors.red, - ce = colors.red, - r = colors.cyan, - rm = colors.cyan, - ['r?'] = colors.cyan, - ['!'] = colors.red, - t = colors.red, - } - return { fg = mode_color[vim.fn.mode()] } - end, - padding = { left = 0, right = 1 }, -- We don't need space before this -} - -ins_left { - -- mode component - function() - return '' - end, - color = function() - -- auto change color according to neovims mode - local mode_color = { - n = colors.green, - i = colors.blue, - v = colors.magenta, - [''] = colors.magenta, - V = colors.magenta, - c = colors.yellow, - no = colors.red, - s = colors.orange, - S = colors.orange, - [''] = colors.orange, - ic = colors.yellow, - R = colors.red, - Rv = colors.violet, - cv = colors.red, - ce = colors.red, - r = colors.cyan, - rm = colors.cyan, - ['r?'] = colors.cyan, - ['!'] = colors.red, - t = colors.red, - } - return { fg = mode_color[vim.fn.mode()] } - end, - padding = { right = 1 }, -} - --- ins_left { --- 'filename', --- cond = conditions.buffer_not_empty, --- color = { fg = colors.magenta, gui = 'bold' }, --- } - -ins_left { - 'buffers', - show_filename_only = false, - hide_filename_extension = false, - show_modified_status = true, - icons_enabled = true, - symbols = { - modified = ' ●', -- Text to show when the buffer is modified - alternate_file = '', -- Text to show to identify the alternate file - directory = '', -- Text to show when the buffer is a directory - }, - buffers_color = { - -- Same values as the general color option can be used here. - active = function() - -- auto change color according to neovims mode - local mode_color = { - n = colors.green, - i = colors.blue, - v = colors.magenta, - [''] = colors.magenta, - V = colors.magenta, - c = colors.yellow, - no = colors.red, - s = colors.orange, - S = colors.orange, - [''] = colors.orange, - ic = colors.yellow, - R = colors.red, - Rv = colors.violet, - cv = colors.red, - ce = colors.red, - r = colors.cyan, - rm = colors.cyan, - ['r?'] = colors.cyan, - ['!'] = colors.red, - t = colors.red, - } - return { fg = mode_color[vim.fn.mode()], gui = 'bold' } - end, - }, -} - -ins_left { - 'diagnostics', - sources = { 'nvim_diagnostic' }, - symbols = { error = ' ', warn = ' ', info = ' ' }, - diagnostics_color = { - color_error = { fg = colors.red }, - color_warn = { fg = colors.yellow }, - color_info = { fg = colors.cyan }, - }, -} - --- Insert mid section. You can make any number of sections in neovim :) --- for lualine it's any number greater then 2 --- ins_left { --- function() --- return '%=' --- end, --- } - -ins_right { - 'filetype', - icons_enabled = true, -- I think icons are cool but Eviline doesn't have them. sigh - color = { fg = colors.blue }, -} - -ins_right { - -- Lsp server name . - function() - local msg = 'no lsp' - local buf_ft = vim.api.nvim_buf_get_option(0, 'filetype') - local clients = vim.lsp.get_clients() - if next(clients) == nil then - icon = '' - return '' - end - for _, client in ipairs(clients) do - local filetypes = client.config.filetypes - if filetypes and vim.fn.index(filetypes, buf_ft) ~= -1 then - return client.name - end - end - return msg - end, - icon = ' ', - color = { fg = colors.cyan }, -} - -ins_right { - 'branch', - icon = '', - color = { fg = colors.violet, gui = 'bold' }, -} - -ins_right { - -- filesize component - 'filesize', - cond = conditions.buffer_not_empty, -} - -ins_right { - 'diff', - -- Is it me or the symbol for modified us really weird - symbols = { added = ' ', modified = '󰝤 ', removed = ' ' }, - diff_color = { - added = { fg = colors.green }, - modified = { fg = colors.orange }, - removed = { fg = colors.red }, - }, - cond = conditions.hide_in_width, -} - -ins_right { 'location' } - -ins_right { - function() - return '▊' - end, - -- color = { fg = colors.green }, - color = function() - -- auto change color according to neovims mode - local mode_color = { - n = colors.green, - i = colors.blue, - v = colors.magenta, - [''] = colors.magenta, - V = colors.magenta, - c = colors.yellow, - no = colors.red, - s = colors.orange, - S = colors.orange, - [''] = colors.orange, - ic = colors.yellow, - R = colors.red, - Rv = colors.violet, - cv = colors.red, - ce = colors.red, - r = colors.cyan, - rm = colors.cyan, - ['r?'] = colors.cyan, - ['!'] = colors.red, - t = colors.red, - } - return { fg = mode_color[vim.fn.mode()] } - end, - padding = { left = 1 }, -} - --- Now don't forget to initialize lualine -lualine.setup(config) - - - - --- require('lualine').setup { --- options = { --- icons_enabled = true, --- theme = 'gruvbox', --- section_separators = { left = '', right = '' }, --- component_separators = { left = '', right = '' }, --- disabled_filetypes = { --- statusline = {}, --- winbar = {}, --- }, --- ignore_focus = {}, --- always_divide_middle = true, --- globalstatus = false, --- refresh = { --- statusline = 1000, --- tabline = 1000, --- winbar = 1000, --- } --- }, --- sections = { --- lualine_a = { 'mode' }, --- lualine_b = { 'branch', 'diff', 'diagnostics' }, --- lualine_c = { 'filename' }, --- lualine_x = { 'buffers' }, --- lualine_y = { 'filetype' }, --- lualine_z = { 'location' } --- }, --- inactive_sections = { --- lualine_a = {}, --- lualine_b = {}, --- lualine_c = { 'filename' }, --- lualine_x = {}, --- lualine_y = {}, --- lualine_z = {} --- }, --- tabline = {}, --- winbar = {}, --- inactive_winbar = {}, --- extensions = {}, --- } diff --git a/.config/nvim/after/plugin/rainbow.lua b/.config/nvim/after/plugin/rainbow.lua deleted file mode 100644 index e0951b8..0000000 --- a/.config/nvim/after/plugin/rainbow.lua +++ /dev/null @@ -1,23 +0,0 @@ --- Rainbow --- This module contains a number of default definitions -local rainbow_delimiters = require 'rainbow-delimiters' - -vim.g.rainbow_delimiters = { - strategy = { - [''] = rainbow_delimiters.strategy['global'], - vim = rainbow_delimiters.strategy['local'], - }, - query = { - [''] = 'rainbow-delimiters', - lua = 'rainbow-blocks', - }, - highlight = { - 'RainbowDelimiterOrange', - 'RainbowDelimiterRed', - 'RainbowDelimiterYellow', - 'RainbowDelimiterBlue', - 'RainbowDelimiterGreen', - 'RainbowDelimiterViolet', - 'RainbowDelimiterCyan', - }, -} diff --git a/.config/nvim/after/plugin/telescope.lua b/.config/nvim/after/plugin/telescope.lua deleted file mode 100644 index 2926204..0000000 --- a/.config/nvim/after/plugin/telescope.lua +++ /dev/null @@ -1,16 +0,0 @@ -local tele = require('telescope') - -tele.setup { - defaults = { - mappings = { - i = { - [''] = false, - [''] = require('telescope.actions').delete_buffer, - [""] = require('telescope.actions').move_selection_next, - [""] = require('telescope.actions').move_selection_previous, - }, - }, - }, -} - -pcall(tele.load_extension, 'fzf') diff --git a/.config/nvim/after/plugin/treesitter.lua b/.config/nvim/after/plugin/treesitter.lua deleted file mode 100644 index 0bc651b..0000000 --- a/.config/nvim/after/plugin/treesitter.lua +++ /dev/null @@ -1,42 +0,0 @@ -require'nvim-treesitter.configs'.setup { - -- A list of parser names, or "all" (the five listed parsers should always be installed) - ensure_installed = { - 'c', - 'cpp', - 'lua', - 'vim', - 'vimdoc', - 'query', - 'go', - 'rust', - 'yaml', - 'regex', - 'markdown', - 'markdown_inline', - 'terraform', - 'comment', - }, - - -- Install parsers synchronously (only applied to `ensure_installed`) - sync_install = false, - - -- Automatically install missing parsers when entering buffer - -- Recommendation: set to false if you don't have `tree-sitter` CLI installed locally - auto_install = true, - - highlight = { - enable = true, - - -- Setting this to true will run `:h syntax` and tree-sitter at the same time. - -- Set this to `true` if you depend on 'syntax' being enabled (like for indentation). - -- Using this option may slow down your editor, and you may see some duplicate highlights. - -- Instead of true it can also be a list of languages - additional_vim_regex_highlighting = false, - }, - incremental_selection = { - enable = true, - }, - indent = { - enable = true, - }, -} diff --git a/.config/nvim/after/plugin/trouble.lua b/.config/nvim/after/plugin/trouble.lua deleted file mode 100644 index c18491c..0000000 --- a/.config/nvim/after/plugin/trouble.lua +++ /dev/null @@ -1,17 +0,0 @@ -require('trouble').setup { - -- icons = true, -} - --- Diagnostic signs --- https://github.com/folke/trouble.nvim/issues/52 -local signs = { - Error = " ", - Warn = " ", - Hint = " ", - Info = " " -} - -for type, icon in pairs(signs) do - local hl = "DiagnosticSign" .. type - vim.fn.sign_define(hl, {text = icon, texthl = hl, numhl = hl}) -end diff --git a/.config/nvim/init.lua b/.config/nvim/init.lua index 7ae4e52..4b3a495 100644 --- a/.config/nvim/init.lua +++ b/.config/nvim/init.lua @@ -15,8 +15,13 @@ Confdir = os.getenv('XDG_CONFIG_HOME') vim.cmd('set runtimepath^=/home/r_bousset/.config/nvim runtimepath+=/home/jozan/.config/nvim/after') vim.cmd('let &packpath = &runtimepath') -require('packs') -require('settings') -require('bindings') -require('langs') -require('hooks') +require('config.lazy') +require('config.settings') +require('config.bindings') +require('config.langs') +require('config.hooks') +require('lsp.arduino') +require('lsp.clangd') +require('lsp.gopls') +require('lsp.luals') +require('lsp.perlnavigator') diff --git a/.config/nvim/lua/bindings.lua b/.config/nvim/lua/bindings.lua deleted file mode 100644 index 2b4013c..0000000 --- a/.config/nvim/lua/bindings.lua +++ /dev/null @@ -1,68 +0,0 @@ -vim.keymap.set('n', '', ':', { noremap = true, silent = false }) -vim.keymap.set('n', '', ':bprevious', { noremap = true, silent = true }) --- vim.keymap.set('n', '', 'zz', { noremap = true, silent = true }) --- vim.keymap.set('n', '', 'zz', { noremap = true, silent = true }) --- vim.keymap.set('n', '', 'zz', { noremap = true, silent = true }) --- vim.keymap.set('n', '', 'zz', { noremap = true, silent = true }) -vim.keymap.set('n', '', ':bnext', { noremap = true, silent = true }) -vim.keymap.set('n', '', 'h', { noremap = true, silent = false }) -vim.keymap.set('n', '', 'j', { noremap = true, silent = false }) -vim.keymap.set('n', '', 'k', { noremap = true, silent = false }) -vim.keymap.set('n', '', 'l', { noremap = true, silent = false }) -vim.keymap.set('n', '', 'o', { noremap = true, silent = false }) -vim.keymap.set('n', '', 'q', { noremap = true, silent = false }) -vim.keymap.set('n', '*', '*zz', { noremap = true, silent = false }) -vim.keymap.set('i', '', 'pumvisible() ? "" : ""', { expr = true }) -vim.keymap.set('i', '', 'pumvisible() ? "" : ""', { expr = true }) -vim.keymap.set('i', '', 'pumvisible() ? asyncomplete#close_popup() : "\\"', { expr = true }) -vim.keymap.set('n', '', vim.cmd.NvimTreeToggle, { noremap = true, silent = true }) -vim.keymap.set('n', '', ':!make-j9', { noremap = true, silent = false }) -vim.keymap.set('n', '', ':Trouble diagnostics toggle focus=true', { noremap = true, silent = true }) -vim.keymap.set('n', '', vim.cmd.UndotreeToggle, { noremap = true, silent = true }) -vim.g.floaterm_keymap_toggle = '' -vim.g.floaterm_keymap_prev = '' -vim.g.floaterm_keymap_next = '' -vim.keymap.set('v', 'J', ":m '>+1gv=gv") -vim.keymap.set('v', 'K', ":m '<-2gv=gv") -vim.keymap.set('x', 'p', "\"_dP") -vim.keymap.set('n', 'Q', '') -vim.keymap.set('n', '', vim.cmd.nohlsearch, { noremap = true, silent = true }) - -local ts = require('telescope.builtin') -require('telescope').load_extension('harpoon') -local harpoon = require('harpoon') -harpoon:setup() - -vim.keymap.set('n', '', function() harpoon:list():select(1) end) -vim.keymap.set('n', '', function() harpoon:list():select(2) end) -vim.keymap.set('n', '', function() harpoon:list():select(3) end) -vim.keymap.set('n', '', function() harpoon:list():select(4) end) - --- normal -vim.keymap.set('n', 'd', ':bn|:bd#', { noremap = true, silent = true }) -vim.keymap.set('n', 'D', '"-ddk:put = strftime(\' * %a %b %d %T %Y\')', { noremap = true, silent = true }) -vim.keymap.set('n', 'k', ':w:bp:bd #', { noremap = true, silent = true }) -vim.keymap.set('n', 'u', vim.cmd.UndotreeToggle, { noremap = true, silent = true }) -vim.keymap.set('n', 'u', ':w', { noremap = true, silent = true }) --- harpoon -vim.keymap.set('n', 'aa', function() harpoon:list():add() end, { noremap = true, silent = true }) -vim.keymap.set('n', 'ae', function() harpoon.ui:toggle_quick_menu(harpoon:list()) end, { noremap = true, silent = true }) -vim.keymap.set('n', 'af', ':Telescope harpoon marks', { noremap = true, silent = true }) --- trouble -vim.keymap.set('n', 'xx', ':Trouble diagnostics toggle focus=true', { noremap = true, silent = true }) -vim.keymap.set('n', 'xw', ':Trouble diagnostics toggle focus=true', { noremap = true, silent = true }) -vim.keymap.set('n', 'xd', ':Trouble diagnostics toggle focus=true filter.buf=0', { noremap = true, silent = true }) -vim.keymap.set('n', 'xl', ':Trouble loclist toggle focus=true', { noremap = true, silent = true }) -vim.keymap.set('n', 'xq', ':Trouble qflist toggle focus=true', { noremap = true, silent = true }) -vim.keymap.set('n', 'xs', ':Trouble lsp toggle focus=true win.position=right', { noremap = true, silent = true }) --- telescope -vim.keymap.set('n', 'fb', ts.buffers, { noremap = true, silent = true }) -vim.keymap.set('n', 'fd', ts.diagnostics, { noremap = true, silent = true }) -vim.keymap.set('n', 'fe', ':Telescope harpoon marks', { noremap = true, silent = true }) -vim.keymap.set('n', 'ff', ts.find_files, { noremap = true, silent = true }) -vim.keymap.set('n', 'fs', ts.live_grep, { noremap = true, silent = true }) -vim.keymap.set('n', 'fg', function() ts.grep_string({ search = vim.fn.input("Grep > ") }) end, { noremap = true, silent = true }) -vim.keymap.set('n', 'ft', ':TodoTelescope keywords=TODO,HACK,WARN,PERF,NOTE,TEST,FIX', { noremap = true, silent = true }) --- neovim -vim.keymap.set('n', 'vu', vim.cmd.PackerSync, { noremap = true, silent = true }) -vim.keymap.set('n', 'vv', vim.cmd.Ex, { noremap = true, silent = true }) diff --git a/.config/nvim/lua/config/bindings.lua b/.config/nvim/lua/config/bindings.lua new file mode 100644 index 0000000..2c5f869 --- /dev/null +++ b/.config/nvim/lua/config/bindings.lua @@ -0,0 +1,69 @@ +vim.keymap.set('n', '', ':', { noremap = true, silent = false }) +vim.keymap.set('n', '', ':bprevious', { noremap = true, silent = true }) +-- vim.keymap.set('n', '', 'zz', { noremap = true, silent = true }) +-- vim.keymap.set('n', '', 'zz', { noremap = true, silent = true }) +-- vim.keymap.set('n', '', 'zz', { noremap = true, silent = true }) +-- vim.keymap.set('n', '', 'zz', { noremap = true, silent = true }) +vim.keymap.set('n', '', ':bnext', { noremap = true, silent = true }) +vim.keymap.set('n', '', 'h', { noremap = true, silent = false }) +vim.keymap.set('n', '', 'j', { noremap = true, silent = false }) +vim.keymap.set('n', '', 'k', { noremap = true, silent = false }) +vim.keymap.set('n', '', 'l', { noremap = true, silent = false }) +vim.keymap.set('n', '', 'o', { noremap = true, silent = false }) +vim.keymap.set('n', '', 'q', { noremap = true, silent = false }) +vim.keymap.set('n', '*', '*zz', { noremap = true, silent = false }) +vim.keymap.set('i', '', 'pumvisible() ? "" : ""', { expr = true }) +vim.keymap.set('i', '', 'pumvisible() ? "" : ""', { expr = true }) +vim.keymap.set('i', '', 'pumvisible() ? asyncomplete#close_popup() : "\\"', { expr = true }) +vim.keymap.set('n', '', vim.cmd.NvimTreeToggle, { noremap = true, silent = true }) +vim.keymap.set('n', '', ':!make-j9', { noremap = true, silent = false }) +vim.keymap.set('n', '', ':Trouble diagnostics toggle focus=true', { noremap = true, silent = true }) +vim.keymap.set('n', '', vim.cmd.UndotreeToggle, { noremap = true, silent = true }) +vim.g.floaterm_keymap_toggle = '' +vim.g.floaterm_keymap_prev = '' +vim.g.floaterm_keymap_next = '' +vim.keymap.set('v', 'J', ":m '>+1gv=gv") +vim.keymap.set('v', 'K', ":m '<-2gv=gv") +vim.keymap.set('x', 'p', "\"_dP") +vim.keymap.set('n', 'Q', '') +vim.keymap.set('n', '', vim.cmd.nohlsearch, { noremap = true, silent = true }) + +local ts = require('telescope.builtin') +require('telescope').load_extension('harpoon') +local harpoon = require('harpoon') +harpoon:setup() + +vim.keymap.set('n', '', function() harpoon:list():select(1) end) +vim.keymap.set('n', '', function() harpoon:list():select(2) end) +vim.keymap.set('n', '', function() harpoon:list():select(3) end) +vim.keymap.set('n', '', function() harpoon:list():select(4) end) + +-- normal +vim.keymap.set('n', 'd', ':bn|:bd#', { noremap = true, silent = true }) +vim.keymap.set('n', 'D', '"-ddk:put = strftime(\' * %a %b %d %T %Y\')', { noremap = true, silent = true }) +vim.keymap.set('n', 'k', ':w:bp:bd #', { noremap = true, silent = true }) +vim.keymap.set('n', 'u', vim.cmd.UndotreeToggle, { noremap = true, silent = true }) +vim.keymap.set('n', 'u', ':w', { noremap = true, silent = true }) +-- harpoon +vim.keymap.set('n', 'aa', function() harpoon:list():add() end, { noremap = true, silent = true }) +vim.keymap.set('n', 'ae', function() harpoon.ui:toggle_quick_menu(harpoon:list()) end, { noremap = true, silent = true }) +vim.keymap.set('n', 'af', ':Telescope harpoon marks', { noremap = true, silent = true }) +-- trouble +vim.keymap.set('n', 'xx', ':Trouble diagnostics toggle focus=true', { noremap = true, silent = true }) +vim.keymap.set('n', 'xw', ':Trouble diagnostics toggle focus=true', { noremap = true, silent = true }) +vim.keymap.set('n', 'xd', ':Trouble diagnostics toggle focus=true filter.buf=0', { noremap = true, silent = true }) +vim.keymap.set('n', 'xl', ':Trouble loclist toggle focus=true', { noremap = true, silent = true }) +vim.keymap.set('n', 'xq', ':Trouble qflist toggle focus=true', { noremap = true, silent = true }) +vim.keymap.set('n', 'xs', ':Trouble lsp toggle focus=true win.position=right', { noremap = true, silent = true }) +-- telescope +vim.keymap.set('n', 'fb', ts.buffers, { noremap = true, silent = true }) +vim.keymap.set('n', 'fd', ts.diagnostics, { noremap = true, silent = true }) +vim.keymap.set('n', 'fe', ':Telescope harpoon marks', { noremap = true, silent = true }) +vim.keymap.set('n', 'ff', ts.find_files, { noremap = true, silent = true }) +vim.keymap.set('n', 'fs', ts.live_grep, { noremap = true, silent = true }) +vim.keymap.set('n', 'fg', function() ts.grep_string({ search = vim.fn.input("Grep > ") }) end, { noremap = true, silent = true }) +vim.keymap.set('n', 'ft', ':TodoTelescope keywords=TODO,HACK,WARN,PERF,NOTE,TEST,FIX', { noremap = true, silent = true }) +-- neovim +vim.keymap.set('n', 'vu', vim.cmd.Lazy, { noremap = true, silent = true }) +vim.keymap.set('n', 'vm', vim.cmd.Mason, { noremap = true, silent = true }) +vim.keymap.set('n', 'vv', vim.cmd.Ex, { noremap = true, silent = true }) diff --git a/.config/nvim/lua/config/hooks.lua b/.config/nvim/lua/config/hooks.lua new file mode 100644 index 0000000..eaf0687 --- /dev/null +++ b/.config/nvim/lua/config/hooks.lua @@ -0,0 +1,8 @@ +vim.api.nvim_create_autocmd({"BufWritePre"}, { + pattern = "*", + callback = function(ev) + save_cursor = vim.fn.getpos(".") + vim.cmd([[%s/\s\+$//e]]) + vim.fn.setpos(".", save_cursor) + end, +}) diff --git a/.config/nvim/lua/config/langs.lua b/.config/nvim/lua/config/langs.lua new file mode 100644 index 0000000..64fe7ea --- /dev/null +++ b/.config/nvim/lua/config/langs.lua @@ -0,0 +1,11 @@ +vim.g.asmsyntax = 'asm' +vim.g.perl_include_pod = 1 +vim.g.perl_compiler_force_warnings = 1 + +-- vim.api.nvim_create_autocmd('BufNewFile,BufRead', { pattern = '*.c,*.h', command = 'set filetype=c'}) +-- vim.api.nvim_create_autocmd('BufNewFile,BufRead', { pattern = '*.cc,*.hh,*.cpp,*.hpp,*.cxx,*.hxx', command = 'set filetype=cpp'}) +-- vim.api.nvim_create_autocmd('BufNewFile,BufRead', { pattern = '*.ms,*.1,*.2,*.3,*.4,*.5,*.6,*.7,*.8,*.9', command = 'set filetype=groff'}) +-- vim.api.nvim_create_autocmd('BufNewFile,BufRead', { pattern = '*.conf', command = 'set filetype=conf'}) +vim.api.nvim_create_autocmd('BufWritePost', { pattern = '*.ms', command = "let pdf=fnamemodify(bufname('%'), ':r') . \".pdf\" | silent! execute \"!nroff % -ms -Tpdf -Kutf8 > \" . pdf"}) +-- vim.api.nvim_create_autocmd('FileType fish', { command = 'compiler fish'}) +-- vim.api.nvim_create_autocmd('FileType perl', { command = 'setlocal com-=:# kp=perldoc\\ -f | compiler perl'}) diff --git a/.config/nvim/lua/config/lazy.lua b/.config/nvim/lua/config/lazy.lua new file mode 100644 index 0000000..64d930a --- /dev/null +++ b/.config/nvim/lua/config/lazy.lua @@ -0,0 +1,117 @@ +local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim" +if not (vim.uv or vim.loop).fs_stat(lazypath) then + local lazyrepo = "https://github.com/folke/lazy.nvim.git" + local out = vim.fn.system({ "git", "clone", "--filter=blob:none", "--branch=stable", lazyrepo, lazypath }) + if vim.v.shell_error ~= 0 then + vim.api.nvim_echo({ + { "Failed to clone lazy.nvim:\n", "ErrorMsg" }, + { out, "WarningMsg" }, + { "\nPress any key to exit..." }, + }, true, {}) + vim.fn.getchar() + os.exit(1) + end +end + +vim.opt.rtp:prepend(lazypath) + +-- Make sure to setup `mapleader` and `maplocalleader` before +-- loading lazy.nvim so that mappings are correct. +-- This is also a good place to setup other settings (vim.opt) +vim.g.mapleader = "\\" +vim.g.maplocalleader = "\\" + +require('lazy').setup({ + spec = { + { + 'windwp/nvim-autopairs', + config = function() require('nvim-autopairs').setup {} end + }, + { + 'lewis6991/gitsigns.nvim', + config = function() require('gitsigns').setup {} end + }, + { + 'numToStr/Comment.nvim', + requires = { {'JoosepAlviste/nvim-ts-context-commentstring'} }, + config = function() + require('Comment').setup() + end + }, + { 'mbbill/undotree' }, + { 'chrisbra/csv.vim' }, + { + 'ThePrimeagen/harpoon', + branch = 'harpoon2', + requires = { {'nvim-lua/plenary.nvim'} } + }, + { + 'lukas-reineke/indent-blankline.nvim', + config = function() + local highlight = { + "Whitespace", + } + require('ibl').setup { + debounce = 100, + indent = { highlight = highlight, char = '┊', }, + scope = { show_start = false, show_end = false }, + } + end, + }, + { + 'folke/todo-comments.nvim', + requires = { {'nvim-lua/plenary.nvim'} }, + config = function() + require('todo-comments.config').setup{ + highlight = { + multiline = false, + }, + } + require('todo-comments') + end + }, + { + 'lcheylus/overlength.nvim', + config = function() + require('overlength').setup{ + enabled = true, + colors = { + ctermfg = nil, + ctermbg = 'darkgrey', + fg = nil, + bg = '#8B0000', + }, + textwidth_mode = 0, + default_overlength = 80, + grace_length = 1, + highlight_to_eol = true, + disable_ft = { 'qf', 'help', 'man', 'checkhealth', 'lazy', 'packer', 'NvimTree', 'Telescope', 'WhichKey', 'text', 'csv', 'lua', '' } + } + end + }, + { + 'kylechui/nvim-surround', + version = "^3.0.0", + event = "VeryLazy", + config = function() + require('nvim-surround').setup() + end + }, + { + 'ggandor/leap.nvim', + requires = {'tpope/vim-repeat'}, + config = function() + require('leap').setup({}) + vim.keymap.set({'n', 'x', 'o'}, 's', '(leap-forward-to)') + vim.keymap.set({'n', 'x', 'o'}, 'S', '(leap-backward-to)') + vim.keymap.set({'n', 'x', 'o'}, '', '(leap-forward-till)') + vim.keymap.set({'n', 'x', 'o'}, '', '(leap-backward-till)') + end + }, + { import = "plugins" }, + }, +}) + +-- use 'preservim/tagbar' +-- use 'sainnhe/gruvbox-material' +-- use 'savq/melange-nvim' diff --git a/.config/nvim/lua/config/settings.lua b/.config/nvim/lua/config/settings.lua new file mode 100644 index 0000000..e578062 --- /dev/null +++ b/.config/nvim/lua/config/settings.lua @@ -0,0 +1,93 @@ +vim.opt.autochdir = false +vim.opt.cindent = true +vim.cmd [[ +set cinoptions=>s,e0,n0,f0,{0,}0,^0,L-1,:s,=s,l1,b0,gs,h0,N0,E0,p0,t0,i0,+s +set cinoptions+=c1,C0,/0,(s,us,U0,w1,Ws,k0,m0,M1,)20,*70,#0 +set clipboard^=unnamedplus +set path+=** +set shortmess+=c +]] +vim.opt.completeopt = 'menuone,noinsert,noselect,preview' +vim.opt.cursorline = true +vim.opt.encoding = 'utf-8' +-- vim.opt.go = 'a' +vim.opt.hidden = true +vim.opt.makeprg = 'make' +vim.opt.mouse = 'a' +vim.opt.compatible = false +vim.opt.expandtab = false +vim.opt.hlsearch = true +vim.opt.incsearch = true +vim.opt.number = true +vim.opt.shiftwidth = 4 +vim.opt.softtabstop = 4 +vim.opt.ruler = true +vim.opt.tabstop = 4 +vim.opt.textwidth = 0 +vim.opt.timeoutlen = 1500 +vim.opt.undodir = '/tmp/nvim_undo' +vim.opt.undofile = true +vim.opt.wildmode = 'longest,list,full' +vim.opt.directory = '/tmp/nvim_swap' +vim.opt.colorcolumn = "80" +vim.opt.scrolloff = 5 +vim.opt.signcolumn = "yes" +vim.o.ignorecase = true +vim.o.smartcase = true +vim.opt.fillchars = {eob = " "} +vim.opt.wrap = true +vim.opt.termguicolors = true +vim.opt.bg = 'dark' + +vim.g.gruvbox_material_background = 'medium' +vim.g.gruvbox_material_foreground = 'original' +vim.g.gruvbox_material_better_performance = 1 + +vim.cmd [[ +syntax on + +" let &t_8f = "\[38;2;%lu;%lu;%lum" +" let &t_8b = "\[48;2;%lu;%lu;%lum" +" let g:deus_termcolors=256 +" colorscheme deus + +" colorscheme gruvbox-material + +" colorscheme gruvbox + +" colorscheme melange + +" let g:onedark_config = { +" \ 'style': 'warmer', +" \} +" colorscheme onedark + + +let &colorcolumn = join(range(80, 400), ',') +filetype plugin indent on +highlight Normal ctermbg=none guibg=none +highlight NonText ctermbg=none guibg=none +highlight LineNr ctermbg=none guibg=none +highlight EndOfBuffer ctermbg=none guibg=none +highlight FloatermBorder guibg=none guifg='#ebdbb2' +highlight SignColumn ctermbg=none guibg=none +" highlight DiagnosticError guifg='#f25942' guibg=none ctermbg=none +" highlight DiagnosticVirtualTextError guifg='#f25942' guibg=none ctermbg=none +" highlight TroubleError guifg='#f25942' guibg=none ctermbg=none +" highlight TroubleSignError guifg='#f25942' guibg=none ctermbg=none +" highlight DiagnosticWarn guifg='#e9b143' guibg=none ctermbg=none +" highlight DiagnosticVirtualTextWarn guifg='#e9b143' guibg=none ctermbg=none +" highlight TroubleWarn guifg='#e9b143' guibg=none ctermbg=none +" highlight TroubleSignWarn guifg='#e9b143' guibg=none ctermbg=none +autocmd FileType * setlocal formatoptions-=c formatoptions-=r formatoptions-=o +]] +vim.g.mapleader = '\\' +vim.g.maplocalleader = '\\' +local highlight_group = vim.api.nvim_create_augroup('YankHighlight', { clear = true }) +vim.api.nvim_create_autocmd('TextYankPost', { + callback = function() + vim.highlight.on_yank() + end, + group = highlight_group, + pattern = '*', +}) diff --git a/.config/nvim/lua/hooks.lua b/.config/nvim/lua/hooks.lua deleted file mode 100644 index eaf0687..0000000 --- a/.config/nvim/lua/hooks.lua +++ /dev/null @@ -1,8 +0,0 @@ -vim.api.nvim_create_autocmd({"BufWritePre"}, { - pattern = "*", - callback = function(ev) - save_cursor = vim.fn.getpos(".") - vim.cmd([[%s/\s\+$//e]]) - vim.fn.setpos(".", save_cursor) - end, -}) diff --git a/.config/nvim/lua/langs.lua b/.config/nvim/lua/langs.lua deleted file mode 100644 index 64fe7ea..0000000 --- a/.config/nvim/lua/langs.lua +++ /dev/null @@ -1,11 +0,0 @@ -vim.g.asmsyntax = 'asm' -vim.g.perl_include_pod = 1 -vim.g.perl_compiler_force_warnings = 1 - --- vim.api.nvim_create_autocmd('BufNewFile,BufRead', { pattern = '*.c,*.h', command = 'set filetype=c'}) --- vim.api.nvim_create_autocmd('BufNewFile,BufRead', { pattern = '*.cc,*.hh,*.cpp,*.hpp,*.cxx,*.hxx', command = 'set filetype=cpp'}) --- vim.api.nvim_create_autocmd('BufNewFile,BufRead', { pattern = '*.ms,*.1,*.2,*.3,*.4,*.5,*.6,*.7,*.8,*.9', command = 'set filetype=groff'}) --- vim.api.nvim_create_autocmd('BufNewFile,BufRead', { pattern = '*.conf', command = 'set filetype=conf'}) -vim.api.nvim_create_autocmd('BufWritePost', { pattern = '*.ms', command = "let pdf=fnamemodify(bufname('%'), ':r') . \".pdf\" | silent! execute \"!nroff % -ms -Tpdf -Kutf8 > \" . pdf"}) --- vim.api.nvim_create_autocmd('FileType fish', { command = 'compiler fish'}) --- vim.api.nvim_create_autocmd('FileType perl', { command = 'setlocal com-=:# kp=perldoc\\ -f | compiler perl'}) diff --git a/.config/nvim/lua/lsp/arduino.lua b/.config/nvim/lua/lsp/arduino.lua new file mode 100644 index 0000000..aedfc7d --- /dev/null +++ b/.config/nvim/lua/lsp/arduino.lua @@ -0,0 +1,13 @@ +vim.lsp.config('arduino-language-server', { + cmd = { + 'arduino-language-server', + '-cli-config', '/home/jozan/.arduino15/arduino-cli.yaml', + '-cli', 'arduino-cli', + '-clangd', 'clangd', + '-fqbn', 'esp32:esp32:esp32', + }, + filetypes = {'arduino'}, + root_markers = {'.git'}, +}) + +vim.lsp.enable('arduino-language-server') diff --git a/.config/nvim/lua/lsp/clangd.lua b/.config/nvim/lua/lsp/clangd.lua new file mode 100644 index 0000000..2933b02 --- /dev/null +++ b/.config/nvim/lua/lsp/clangd.lua @@ -0,0 +1,11 @@ +vim.lsp.config('clangd', { + cmd = { 'clangd', '--background-index', '--clang-tidy', '--completion-style=detailed' }, + filetypes = { 'c', 'cpp', 'objc', 'objcpp' }, + root_markers = { '.clangd', 'compile_commands.json', 'compile_flags.txt', '.git' }, + init_options = { + fallbackFlags = { '-std=c17' }, + offsetEncoding = { 'utf-16' }, + }, +}) + +vim.lsp.enable('clangd') diff --git a/.config/nvim/lua/lsp/gopls.lua b/.config/nvim/lua/lsp/gopls.lua new file mode 100644 index 0000000..c37da39 --- /dev/null +++ b/.config/nvim/lua/lsp/gopls.lua @@ -0,0 +1,25 @@ +vim.lsp.config('gopls', { + cmd = {'gopls'}, + filetypes = { 'go', 'gomod', 'gowork', 'gotmpl' }, + root_markers = {'go.mod', 'go.sum', '.git'}, + settings = { + gopls = { + analyses = { + unreachable = true, + unusedparams = true, + }, + codelenses = { + generate = true, + gc_details = true, + }, + annotations = { + bounds = true, + escape = true, + inline = true, + }, + gofumpt = true, + } + } +}) + +vim.lsp.enable('gopls') diff --git a/.config/nvim/lua/lsp/luals.lua b/.config/nvim/lua/lsp/luals.lua new file mode 100644 index 0000000..0b24166 --- /dev/null +++ b/.config/nvim/lua/lsp/luals.lua @@ -0,0 +1,7 @@ +vim.lsp.config('luals', { + cmd = {'lua-language-server'}, + filetypes = {'lua'}, + root_markers = {'.luarc.json', '.luarc.jsonc'} +}) + +vim.lsp.enable('luals') diff --git a/.config/nvim/lua/lsp/perlnavigator.lua b/.config/nvim/lua/lsp/perlnavigator.lua new file mode 100644 index 0000000..1ba0024 --- /dev/null +++ b/.config/nvim/lua/lsp/perlnavigator.lua @@ -0,0 +1,16 @@ +vim.lsp.config('perlnavigator', { + cmd = {'perlnavigator'}, + filetypes = {'perl'}, + root_markers = {'.git'}, + settings = { + perlnavigator = { + perlPath = 'perl', + enableWarnings = true, + perltidyProfile = '', + perlcriticProfile = '', + perlcriticEnabled = true, + } + } +}) + +vim.lsp.enable('perlnavigator') diff --git a/.config/nvim/lua/packs.lua b/.config/nvim/lua/packs.lua deleted file mode 100644 index dbf3e19..0000000 --- a/.config/nvim/lua/packs.lua +++ /dev/null @@ -1,171 +0,0 @@ -vim.cmd.packadd('packer.nvim') - -return require('packer').startup({function(use) - -- Packer can manage itself - use 'wbthomason/packer.nvim' - use { - 'nvim-telescope/telescope.nvim', - branch = '0.1.x', - requires = { {'nvim-lua/plenary.nvim'} } - } - use { - 'windwp/nvim-autopairs', - config = function() require('nvim-autopairs').setup {} end - } - -- use 'jiangmiao/auto-pairs' - -- use 'folke/which-key.nvim' - use 'lewis6991/gitsigns.nvim' - -- use 'mhinz/vim-startify' - -- use 'mg979/vim-visual-multi' - use 'preservim/tagbar' - -- use 'preservim/nerdcommenter' - use { - 'numToStr/Comment.nvim', - requires = { {'JoosepAlviste/nvim-ts-context-commentstring'} }, - config = function() - require('Comment').setup() - end - } - -- use { - -- 'nvim-tree/nvim-tree.lua', - -- requires = {'nvim-tree/nvim-web-devicons'} - -- } - use 'mbbill/undotree' - -- use 'brglng/vim-sidebar-manager' - use 'ellisonleao/gruvbox.nvim' - use 'sainnhe/gruvbox-material' - use 'navarasu/onedark.nvim' - use 'rebelot/kanagawa.nvim' - use 'theniceboy/nvim-deus' - use 'savq/melange-nvim' - use 'tpope/vim-fugitive' - -- use 'tpope/vim-surround' - use 'nvim-lualine/lualine.nvim' - -- use 'voldikss/vim-floaterm' - -- use 'akinsho/toggleterm.nvim' - use 'chrisbra/csv.vim' - use { - 'ThePrimeagen/harpoon', - branch = 'harpoon2', - requires = { {'nvim-lua/plenary.nvim'} } - } - use 'HiPhish/rainbow-delimiters.nvim' - use { - 'nvim-treesitter/nvim-treesitter-textobjects', - requires = { {'nvim-treesitter/nvim-treesitter'} }, - run = function() - local ts_update = require('nvim-treesitter.install').update({ with_sync = true }) - ts_update() - end, - } - use { - 'VonHeikemen/lsp-zero.nvim', - branch = 'v3.x', - requires = { - -- LSP Support - {'neovim/nvim-lspconfig'}, - {'williamboman/mason.nvim'}, - {'williamboman/mason-lspconfig.nvim'}, - - -- Autocompletion - {'hrsh7th/nvim-cmp'}, - {'hrsh7th/cmp-buffer'}, - {'hrsh7th/cmp-path'}, - {'saadparwaiz1/cmp_luasnip'}, - {'hrsh7th/cmp-nvim-lsp'}, - {'hrsh7th/cmp-nvim-lua'}, - - -- Snippets - {'L3MON4D3/LuaSnip'}, - {'rafamadriz/friendly-snippets'}, - } - } - use{ - 'folke/trouble.nvim', - requires = { - {'nvim-tree/nvim-web-devicons'}, - }, - } - use { - 'lukas-reineke/indent-blankline.nvim', - config = function() - local highlight = { - "Whitespace", - } - require('ibl').setup { - debounce = 100, - indent = { highlight = highlight, char = '┊', }, - scope = { show_start = false, show_end = false }, - } - end, - } - use ({ - 'folke/todo-comments.nvim', - requires = { {'nvim-lua/plenary.nvim'} }, - config = function() - require('todo-comments.config').setup{ - highlight = { - multiline = false, - }, - } - require('todo-comments') - end - }) - use 'onsails/lspkind.nvim' - use ({ - 'lcheylus/overlength.nvim', - config = function() - require('overlength').setup({ - enabled = true, - colors = { - ctermfg = nil, - ctermbg = 'darkgrey', - fg = nil, - bg = '#8B0000', - }, - textwidth_mode = 0, - default_overlength = 80, - grace_length = 1, - highlight_to_eol = true, - disable_ft = { 'qf', 'help', 'man', 'checkhealth', 'lazy', 'packer', 'NvimTree', 'Telescope', 'WhichKey', 'text' }, - }) - end - }) --- use({ --- "tadmccorkle/markdown.nvim", --- config = function() --- require("markdown").setup({ --- -- configuration here or empty for defaults --- }) --- end, --- }) - use({ - "kylechui/nvim-surround", - requires = { - {'nvim-treesitter/nvim-treesitter'}, - {'nvim-treesitter/nvim-treesitter-textobjects'}, - }, - tag = "*", -- Use for stability; omit to use `main` branch for the latest features - config = function() - require("nvim-surround").setup({ - -- Configuration here, or leave empty to use defaults - }) - end - }) - use({ - 'ggandor/leap.nvim', - requires = {'tpope/vim-repeat'}, - config = function() - require('leap').setup({}) - vim.keymap.set({'n', 'x', 'o'}, 's', '(leap-forward-to)') - vim.keymap.set({'n', 'x', 'o'}, 'S', '(leap-backward-to)') - vim.keymap.set({'n', 'x', 'o'}, '', '(leap-forward-till)') - vim.keymap.set({'n', 'x', 'o'}, '', '(leap-backward-till)') - end - }) -end, - config = { - display = { - open_fn = require('packer.util').float, - } -}}) diff --git a/.config/nvim/lua/plugins/gruvbox.lua b/.config/nvim/lua/plugins/gruvbox.lua new file mode 100644 index 0000000..bf99776 --- /dev/null +++ b/.config/nvim/lua/plugins/gruvbox.lua @@ -0,0 +1,38 @@ +return { + { + 'ellisonleao/gruvbox.nvim', + lazy = false, + priority = 1000, + opts = { + terminal_colors = false, + undercurl = true, + underline = true, + bold = false, + italic = { + strings = false, + emphasis = true, + comments = true, + operators = false, + folds = true, + }, + strikethrough = true, + invert_selection = false, + invert_signs = false, + invert_tabline = false, + invert_intend_guides = false, + inverse = true, -- invert background for search, diffs, statuslines and errors + contrast = "hard", -- can be "hard", "soft" or empty string + palette_overrides = {}, + overrides = { + ["@punctuation.delimiter"] = { fg = "#928374" }, + String = { fg = "#8ec07c" }, + }, + dim_inactive = false, + transparent_mode = true, + }, + config = function(_, opts) + require('gruvbox').setup(opts) + vim.cmd([[colorscheme gruvbox]]) + end + } +} diff --git a/.config/nvim/lua/plugins/lspkind.lua b/.config/nvim/lua/plugins/lspkind.lua new file mode 100644 index 0000000..b1fc6d1 --- /dev/null +++ b/.config/nvim/lua/plugins/lspkind.lua @@ -0,0 +1,102 @@ +return { + { + 'onsails/lspkind.nvim', + config = function() + require('lspkind').setup({ + mode = 'symbol_text', + preset = 'codicons', + symbol_map = { + Text = "󰉿", + Method = "󰆧", + Function = "󰊕", + Constructor = "", + Field = "󰜢", + Variable = "󰀫", + Class = "󰠱", + Interface = "", + Module = "", + Property = "󰜢", + Unit = "󰑭", + Value = "󰎠", + Enum = "", + Keyword = "󰌋", + Snippet = "", + Color = "󰏘", + File = "󰈙", + Reference = "󰈇", + Folder = "󰉋", + EnumMember = "", + Constant = "󰏿", + Struct = "󰙅", + Event = "", + Operator = "󰆕", + TypeParameter = "", + }, + }) + end + }, + { + "hrsh7th/nvim-cmp", + dependencies = { + "onsails/lspkind.nvim", + "hrsh7th/cmp-nvim-lsp", + "hrsh7th/cmp-buffer", + "hrsh7th/cmp-path", + "L3MON4D3/LuaSnip", + }, + event = "InsertEnter", + config = function() + local cmp = require('cmp') + local lspkind = require('lspkind') + + cmp.setup({ + snippet = { + expand = function(args) + require('luasnip').lsp_expand(args.body) + end, + }, + formatting = { + format = lspkind.cmp_format({ + mode = 'symbol_text', + maxwidth = { + menu = 50, + abbr = 50, + }, + ellipsis_char = '...', + show_labelDetails = true, + before = function(entry, vim_item) + -- Add source name to menu + vim_item.menu = ({ + nvim_lsp = "[LSP]", + luasnip = "[LuaSnip]", + buffer = "[Buffer]", + path = "[Path]", + })[entry.source.name] + return vim_item + end + }) + }, + mapping = cmp.mapping.preset.insert({ + [''] = cmp.mapping.select_next_item(cmp_select), + [''] = cmp.mapping.select_prev_item(cmp_select), + [''] = cmp.mapping.scroll_docs(-4), + [''] = cmp.mapping.scroll_docs(4), + [''] = cmp.mapping.complete(), + [''] = cmp.mapping.abort(), + [''] = cmp.mapping.confirm({ select = true }), + }), + sources = cmp.config.sources({ + { name = 'nvim_lsp' }, + { name = 'luasnip' }, + }, { + { name = 'buffer' }, + { name = 'path' }, + }), + window = { + completion = cmp.config.window.bordered(), + documentation = cmp.config.window.bordered(), + }, + }) + end, + }, +} diff --git a/.config/nvim/lua/plugins/lualine.lua b/.config/nvim/lua/plugins/lualine.lua new file mode 100644 index 0000000..4c2c6d3 --- /dev/null +++ b/.config/nvim/lua/plugins/lualine.lua @@ -0,0 +1,298 @@ +return { + { + 'nvim-lualine/lualine.nvim', + dependencies = { 'nvim-tree/nvim-web-devicons' }, + config = function() + local colors = { + bg = '#202328', + fg = '#a89984', + yellow = '#ecbe7b', + cyan = '#008080', + darkblue = '#081633', + green = '#98be65', + orange = '#ff8800', + violet = '#a9a1e1', + magenta = '#c678dd', + blue = '#51afef', + red = '#ec5f67', + } + + local conditions = { + buffer_not_empty = function() + return vim.fn.empty(vim.fn.expand('%:t')) ~= 1 + end, + hide_in_width = function() + return vim.fn.winwidth(0) > 80 + end, + check_git_workspace = function() + local filepath = vim.fn.expand('%:p:h') + local gitdir = vim.fn.finddir('.git', filepath .. ';') + return gitdir and #gitdir > 0 and #gitdir < #filepath + end, + } + + local config = { + options = { + -- Disable sections and component separators + component_separators = '', + section_separators = '', + theme = { + -- We are going to use lualine_c an lualine_x as left and + -- right section. Both are highlighted by c theme . So we + -- are just setting default looks o statusline + normal = { c = { fg = colors.fg, bg = colors.bg } }, + inactive = { c = { fg = colors.fg, bg = colors.bg } }, + }, + }, + sections = { + -- these are to remove the defaults + lualine_a = {}, + lualine_b = {}, + lualine_y = {}, + lualine_z = {}, + -- These will be filled later + lualine_c = {}, + lualine_x = {}, + }, + inactive_sections = { + -- these are to remove the defaults + lualine_a = {}, + lualine_b = {}, + lualine_y = {}, + lualine_z = {}, + lualine_c = {}, + lualine_x = {}, + }, + } + + -- Inserts a component in lualine_c at left section + local function ins_left(component) + table.insert(config.sections.lualine_c, component) + end + + -- Inserts a component in lualine_x at right section + local function ins_right(component) + table.insert(config.sections.lualine_x, component) + end + + ins_left { + function() + return '▊' + end, + -- color = { fg = colors.green }, -- Sets highlighting of component + color = function() + -- auto change color according to neovims mode + local mode_color = { + n = colors.green, + i = colors.blue, + v = colors.magenta, + [''] = colors.magenta, + V = colors.magenta, + c = colors.yellow, + no = colors.red, + s = colors.orange, + S = colors.orange, + [''] = colors.orange, + ic = colors.yellow, + R = colors.red, + Rv = colors.violet, + cv = colors.red, + ce = colors.red, + r = colors.cyan, + rm = colors.cyan, + ['r?'] = colors.cyan, + ['!'] = colors.red, + t = colors.red, + } + return { fg = mode_color[vim.fn.mode()] } + end, + padding = { left = 0, right = 1 }, -- We don't need space before this + } + + ins_left { + -- mode component + function() + return '' + end, + color = function() + -- auto change color according to neovims mode + local mode_color = { + n = colors.green, + i = colors.blue, + v = colors.magenta, + [''] = colors.magenta, + V = colors.magenta, + c = colors.yellow, + no = colors.red, + s = colors.orange, + S = colors.orange, + [''] = colors.orange, + ic = colors.yellow, + R = colors.red, + Rv = colors.violet, + cv = colors.red, + ce = colors.red, + r = colors.cyan, + rm = colors.cyan, + ['r?'] = colors.cyan, + ['!'] = colors.red, + t = colors.red, + } + return { fg = mode_color[vim.fn.mode()] } + end, + padding = { right = 1 }, + } + + ins_left { + 'buffers', + show_filename_only = false, + hide_filename_extension = false, + show_modified_status = true, + icons_enabled = true, + symbols = { + modified = ' ●', -- Text to show when the buffer is modified + alternate_file = '', -- Text to show to identify the alternate file + directory = '', -- Text to show when the buffer is a directory + }, + buffers_color = { + -- Same values as the general color option can be used here. + active = function() + -- auto change color according to neovims mode + local mode_color = { + n = colors.green, + i = colors.blue, + v = colors.magenta, + [''] = colors.magenta, + V = colors.magenta, + c = colors.yellow, + no = colors.red, + s = colors.orange, + S = colors.orange, + [''] = colors.orange, + ic = colors.yellow, + R = colors.red, + Rv = colors.violet, + cv = colors.red, + ce = colors.red, + r = colors.cyan, + rm = colors.cyan, + ['r?'] = colors.cyan, + ['!'] = colors.red, + t = colors.red, + } + return { fg = mode_color[vim.fn.mode()], gui = 'bold' } + end, + }, + } + + ins_left { + 'diagnostics', + sources = { 'nvim_diagnostic' }, + symbols = { error = ' ', warn = ' ', info = ' ' }, + diagnostics_color = { + color_error = { fg = colors.red }, + color_warn = { fg = colors.yellow }, + color_info = { fg = colors.cyan }, + }, + } + + -- Insert mid section. You can make any number of sections in neovim :) + -- for lualine it's any number greater then 2 + -- ins_left { + -- function() + -- return '%=' + -- end, + -- } + + ins_right { + 'filetype', + icons_enabled = true, -- I think icons are cool but Eviline doesn't have them. sigh + color = { fg = colors.blue }, + } + + ins_right { + -- Lsp server name . + function() + local msg = 'no lsp' + local buf_ft = vim.api.nvim_buf_get_option(0, 'filetype') + local clients = vim.lsp.get_clients() + if next(clients) == nil then + icon = '' + return '' + end + for _, client in ipairs(clients) do + local filetypes = client.config.filetypes + if filetypes and vim.fn.index(filetypes, buf_ft) ~= -1 then + return client.name + end + end + return msg + end, + icon = ' ', + color = { fg = colors.cyan }, + } + + ins_right { + 'branch', + icon = '', + color = { fg = colors.violet, gui = 'bold' }, + } + + ins_right { + -- filesize component + 'filesize', + cond = conditions.buffer_not_empty, + } + + ins_right { + 'diff', + -- Is it me or the symbol for modified us really weird + symbols = { added = ' ', modified = '󰝤 ', removed = ' ' }, + diff_color = { + added = { fg = colors.green }, + modified = { fg = colors.orange }, + removed = { fg = colors.red }, + }, + cond = conditions.hide_in_width, + } + + ins_right { 'location' } + + ins_right { + function() + return '▊' + end, + -- color = { fg = colors.green }, + color = function() + -- auto change color according to neovims mode + local mode_color = { + n = colors.green, + i = colors.blue, + v = colors.magenta, + [''] = colors.magenta, + V = colors.magenta, + c = colors.yellow, + no = colors.red, + s = colors.orange, + S = colors.orange, + [''] = colors.orange, + ic = colors.yellow, + R = colors.red, + Rv = colors.violet, + cv = colors.red, + ce = colors.red, + r = colors.cyan, + rm = colors.cyan, + ['r?'] = colors.cyan, + ['!'] = colors.red, + t = colors.red, + } + return { fg = mode_color[vim.fn.mode()] } + end, + padding = { left = 1 }, + } + + require('lualine').setup(config) + end + } +} diff --git a/.config/nvim/lua/plugins/rainbow.lua b/.config/nvim/lua/plugins/rainbow.lua new file mode 100644 index 0000000..740b712 --- /dev/null +++ b/.config/nvim/lua/plugins/rainbow.lua @@ -0,0 +1,28 @@ +return { + { + 'HiPhish/rainbow-delimiters.nvim', + config = function() + local rainbow_delimiters = require('rainbow-delimiters') + + vim.g.rainbow_delimiters = { + strategy = { + [''] = rainbow_delimiters.strategy['global'], + vim = rainbow_delimiters.strategy['local'], + }, + query = { + [''] = 'rainbow-delimiters', + lua = 'rainbow-blocks', + }, + highlight = { + 'RainbowDelimiterOrange', + 'RainbowDelimiterRed', + 'RainbowDelimiterYellow', + 'RainbowDelimiterBlue', + 'RainbowDelimiterGreen', + 'RainbowDelimiterViolet', + 'RainbowDelimiterCyan', + }, + } + end + } +} diff --git a/.config/nvim/lua/plugins/telescope.lua b/.config/nvim/lua/plugins/telescope.lua new file mode 100644 index 0000000..ca80e16 --- /dev/null +++ b/.config/nvim/lua/plugins/telescope.lua @@ -0,0 +1,25 @@ +return { + { + 'nvim-telescope/telescope.nvim', + branch = '0.1.x', + dependencies = { 'nvim-lua/plenary.nvim' }, + config = function() + local tele = require('telescope') + + tele.setup { + defaults = { + mappings = { + i = { + [''] = false, + [''] = require('telescope.actions').delete_buffer, + [""] = require('telescope.actions').move_selection_next, + [""] = require('telescope.actions').move_selection_previous, + }, + }, + }, + } + + pcall(tele.load_extension, 'fzf') + end, + }, +} diff --git a/.config/nvim/lua/plugins/treesitter.lua b/.config/nvim/lua/plugins/treesitter.lua new file mode 100644 index 0000000..5387ac6 --- /dev/null +++ b/.config/nvim/lua/plugins/treesitter.lua @@ -0,0 +1,53 @@ +return { + { + 'nvim-treesitter/nvim-treesitter', + branch = 'master', + lazy = false, + build = ':TSUpdate', + config = function() + require('nvim-treesitter.configs').setup { + -- A list of parser names, or "all" (the five listed parsers should always be installed) + ensure_installed = { + 'c', + 'cpp', + 'lua', + 'vim', + 'vimdoc', + 'query', + 'go', + 'perl', + 'rust', + 'yaml', + 'regex', + 'markdown', + 'markdown_inline', + 'terraform', + 'comment', + }, + + -- Install parsers synchronously (only applied to `ensure_installed`) + sync_install = false, + + -- Automatically install missing parsers when entering buffer + -- Recommendation: set to false if you don't have `tree-sitter` CLI installed locally + auto_install = true, + + highlight = { + enable = true, + + -- Setting this to true will run `:h syntax` and tree-sitter at the same time. + -- Set this to `true` if you depend on 'syntax' being enabled (like for indentation). + -- Using this option may slow down your editor, and you may see some duplicate highlights. + -- Instead of true it can also be a list of languages + additional_vim_regex_highlighting = false, + }, + incremental_selection = { + enable = true, + }, + indent = { + enable = true, + }, + } + end + } +} diff --git a/.config/nvim/lua/plugins/trouble.lua b/.config/nvim/lua/plugins/trouble.lua new file mode 100644 index 0000000..11c23a3 --- /dev/null +++ b/.config/nvim/lua/plugins/trouble.lua @@ -0,0 +1,27 @@ +return { + { + 'folke/trouble.nvim', + requires = { + {'nvim-tree/nvim-web-devicons'}, + }, + config = function() + require('trouble').setup { + -- icons = true, + } + + -- Diagnostic signs + -- https://github.com/folke/trouble.nvim/issues/52 + local signs = { + Error = " ", + Warn = " ", + Hint = " ", + Info = " " + } + + for type, icon in pairs(signs) do + local hl = "DiagnosticSign" .. type + vim.fn.sign_define(hl, {text = icon, texthl = hl, numhl = hl}) + end + end + } +} diff --git a/.config/nvim/lua/settings.lua b/.config/nvim/lua/settings.lua deleted file mode 100644 index e578062..0000000 --- a/.config/nvim/lua/settings.lua +++ /dev/null @@ -1,93 +0,0 @@ -vim.opt.autochdir = false -vim.opt.cindent = true -vim.cmd [[ -set cinoptions=>s,e0,n0,f0,{0,}0,^0,L-1,:s,=s,l1,b0,gs,h0,N0,E0,p0,t0,i0,+s -set cinoptions+=c1,C0,/0,(s,us,U0,w1,Ws,k0,m0,M1,)20,*70,#0 -set clipboard^=unnamedplus -set path+=** -set shortmess+=c -]] -vim.opt.completeopt = 'menuone,noinsert,noselect,preview' -vim.opt.cursorline = true -vim.opt.encoding = 'utf-8' --- vim.opt.go = 'a' -vim.opt.hidden = true -vim.opt.makeprg = 'make' -vim.opt.mouse = 'a' -vim.opt.compatible = false -vim.opt.expandtab = false -vim.opt.hlsearch = true -vim.opt.incsearch = true -vim.opt.number = true -vim.opt.shiftwidth = 4 -vim.opt.softtabstop = 4 -vim.opt.ruler = true -vim.opt.tabstop = 4 -vim.opt.textwidth = 0 -vim.opt.timeoutlen = 1500 -vim.opt.undodir = '/tmp/nvim_undo' -vim.opt.undofile = true -vim.opt.wildmode = 'longest,list,full' -vim.opt.directory = '/tmp/nvim_swap' -vim.opt.colorcolumn = "80" -vim.opt.scrolloff = 5 -vim.opt.signcolumn = "yes" -vim.o.ignorecase = true -vim.o.smartcase = true -vim.opt.fillchars = {eob = " "} -vim.opt.wrap = true -vim.opt.termguicolors = true -vim.opt.bg = 'dark' - -vim.g.gruvbox_material_background = 'medium' -vim.g.gruvbox_material_foreground = 'original' -vim.g.gruvbox_material_better_performance = 1 - -vim.cmd [[ -syntax on - -" let &t_8f = "\[38;2;%lu;%lu;%lum" -" let &t_8b = "\[48;2;%lu;%lu;%lum" -" let g:deus_termcolors=256 -" colorscheme deus - -" colorscheme gruvbox-material - -" colorscheme gruvbox - -" colorscheme melange - -" let g:onedark_config = { -" \ 'style': 'warmer', -" \} -" colorscheme onedark - - -let &colorcolumn = join(range(80, 400), ',') -filetype plugin indent on -highlight Normal ctermbg=none guibg=none -highlight NonText ctermbg=none guibg=none -highlight LineNr ctermbg=none guibg=none -highlight EndOfBuffer ctermbg=none guibg=none -highlight FloatermBorder guibg=none guifg='#ebdbb2' -highlight SignColumn ctermbg=none guibg=none -" highlight DiagnosticError guifg='#f25942' guibg=none ctermbg=none -" highlight DiagnosticVirtualTextError guifg='#f25942' guibg=none ctermbg=none -" highlight TroubleError guifg='#f25942' guibg=none ctermbg=none -" highlight TroubleSignError guifg='#f25942' guibg=none ctermbg=none -" highlight DiagnosticWarn guifg='#e9b143' guibg=none ctermbg=none -" highlight DiagnosticVirtualTextWarn guifg='#e9b143' guibg=none ctermbg=none -" highlight TroubleWarn guifg='#e9b143' guibg=none ctermbg=none -" highlight TroubleSignWarn guifg='#e9b143' guibg=none ctermbg=none -autocmd FileType * setlocal formatoptions-=c formatoptions-=r formatoptions-=o -]] -vim.g.mapleader = '\\' -vim.g.maplocalleader = '\\' -local highlight_group = vim.api.nvim_create_augroup('YankHighlight', { clear = true }) -vim.api.nvim_create_autocmd('TextYankPost', { - callback = function() - vim.highlight.on_yank() - end, - group = highlight_group, - pattern = '*', -}) -- cgit v1.2.3