diff options
Diffstat (limited to 'neovim/.config/nvim/lua')
17 files changed, 540 insertions, 72 deletions
diff --git a/neovim/.config/nvim/lua/config/colourscheme.lua b/neovim/.config/nvim/lua/config/colourscheme.lua index edba16f..78e71a5 100644 --- a/neovim/.config/nvim/lua/config/colourscheme.lua +++ b/neovim/.config/nvim/lua/config/colourscheme.lua @@ -1,4 +1,4 @@ -local colorscheme = "xcode" +local colorscheme = "xcodehc" vim.o.background = "light" local ok, _ = pcall(vim.cmd, "colorscheme " .. colorscheme) if not ok then diff --git a/neovim/.config/nvim/lua/config/lazy.lua b/neovim/.config/nvim/lua/config/lazy.lua index 7e08cf4..f9671dc 100644 --- a/neovim/.config/nvim/lua/config/lazy.lua +++ b/neovim/.config/nvim/lua/config/lazy.lua @@ -1,5 +1,6 @@ -- Bootstrap lazy.nvim local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim" +---@diagnostic disable-next-line: undefined-field 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 }) @@ -29,7 +30,7 @@ require("lazy").setup({ }, -- Configure any other settings here. See the documentation for more details. -- colorscheme that will be used when installing plugins. - install = { colorscheme = { "xcode" }, missing = true }, + install = { colorscheme = { "xcodehc" }, missing = true }, -- automatically check for plugin updates checker = { enabled = true, notify = false }, }) diff --git a/neovim/.config/nvim/lua/config/lualine.lua b/neovim/.config/nvim/lua/config/lualine.lua new file mode 100644 index 0000000..f2883d7 --- /dev/null +++ b/neovim/.config/nvim/lua/config/lualine.lua @@ -0,0 +1,222 @@ +-- Eviline config for lualine +-- Author: shadmansaleh +-- Credit: glepnir +local lualine = require('lualine') + +-- Color table for highlights +--stylua: ignore +local colors = { + bg = 'StatusLine', + fg = 'StatusLine', + yellow = vim.g.terminal_color_11, + cyan = vim.g.terminal_color_14, + darkblue = vim.g.terminal_color_4, + green = vim.g.terminal_color_10, + orange = vim.g.terminal_color_3, + violet = vim.g.terminal_color_5, + magenta = vim.g.terminal_color_13, + blue = vim.g.terminal_color_12, + red = vim.g.terminal_color_9, +} + +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 = {}, + }, + extensions = { 'lazy', 'neo-tree' }, +} + +-- 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.blue }, -- Sets highlighting of component + 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.red, + i = colors.green, + v = colors.blue, + [''] = colors.blue, + V = colors.blue, + c = colors.magenta, + no = colors.red, + s = colors.orange, + S = colors.orange, + [''] = colors.orange, + ic = colors.yellow, + R = colors.violet, + 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 { + -- filesize component + 'filesize', + cond = conditions.buffer_not_empty, +} + +ins_left { + 'filetype', + cond = conditions.buffer_not_empty, + icon_only = true, +} + +ins_left { + 'filename', + cond = conditions.buffer_not_empty, + color = { fg = colors.magenta, gui = 'bold' }, +} + +ins_left { 'location' } + +ins_left { 'progress', color = { fg = colors.fg, gui = 'bold' } } + +ins_left { + 'diagnostics', + sources = { 'nvim_diagnostic' }, + symbols = { error = ' ', warn = ' ', info = ' ' }, + diagnostics_color = { + error = { fg = colors.red }, + warn = { fg = colors.yellow }, + 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_left { + -- Lsp server name . + function() + local msg = 'No Active Lsp' + local buf_ft = vim.api.nvim_buf_get_option(0, 'filetype') + local clients = vim.lsp.get_active_clients() + if next(clients) == nil then + return msg + 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, + cond = function() + local tbl = { ['dashboard'] = true, [''] = true } + if tbl[vim.bo.filetype] then + return false + elseif next(vim.lsp.get_active_clients()) == nil then + return false + end + return true + end, + icon = '⚙ LSP:', + color = { fg = colors.fg, gui = 'bold' }, +} + +ins_right { + 'branch', + icon = '', + color = { fg = colors.violet, gui = 'bold' }, +} + +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 { + function() + return '▊' + end, + color = { fg = colors.blue }, + padding = { left = 1 }, +} + +-- Now don't forget to initialize lualine +lualine.setup(config) diff --git a/neovim/.config/nvim/lua/plugins/aider.lua b/neovim/.config/nvim/lua/plugins/aider.lua new file mode 100644 index 0000000..709c00b --- /dev/null +++ b/neovim/.config/nvim/lua/plugins/aider.lua @@ -0,0 +1,23 @@ +return { + { + "ddzero2c/aider.nvim", + config = function() + require("aider").setup({ + command = 'aider', -- Path to aider command + model = 'ollama_chat/qwen2.5', -- AI model to use + mode = 'diff', -- Edit mode: 'diff' or 'inline' + -- Floating window options + float_opts = { + relative = 'editor', + width = 0.8, -- 80% of editor width + height = 0.8, -- 80% of editor height + style = 'minimal', + border = 'rounded', + title = ' Aider ', + title_pos = 'center', + }, + }) + vim.keymap.set({ 'v', 'n' }, 'ga', ':AiderEdit<CR>', { noremap = true, silent = true }) + end + } +} diff --git a/neovim/.config/nvim/lua/plugins/cspell.lua b/neovim/.config/nvim/lua/plugins/cspell.lua new file mode 100644 index 0000000..33931b5 --- /dev/null +++ b/neovim/.config/nvim/lua/plugins/cspell.lua @@ -0,0 +1,23 @@ +return { + { + 'nvimtools/none-ls.nvim', + dependencies = { + { + 'davidmh/cspell.nvim', + }, + }, + config = function () + local cspell = require('cspell') + require('null-ls').setup { + sources = { + cspell.diagnostics, + cspell.code_actions, + }, + should_attach = function(bufnr) + local bufname = vim.api.nvim_buf_get_name(bufnr) + return not bufname == 'gen.nvim' + end, + } + end, + } +} diff --git a/neovim/.config/nvim/lua/plugins/gen.lua b/neovim/.config/nvim/lua/plugins/gen.lua new file mode 100644 index 0000000..2fa89a5 --- /dev/null +++ b/neovim/.config/nvim/lua/plugins/gen.lua @@ -0,0 +1,7 @@ +return { + 'David-Kunz/gen.nvim', + opts = { + model = 'qwen2.5-coder:7b', + display_mode = 'split', + } +} diff --git a/neovim/.config/nvim/lua/plugins/goyo.lua b/neovim/.config/nvim/lua/plugins/goyo.lua index bfe797a..5f70048 100644 --- a/neovim/.config/nvim/lua/plugins/goyo.lua +++ b/neovim/.config/nvim/lua/plugins/goyo.lua @@ -17,14 +17,12 @@ return { vim.opt.scrolloff = 999 vim.opt.laststatus = 0 - local gl = require('galaxyline') - local gls = gl.section - gls.left = {} - gls.mid = {} - gls.right = {} + require('lualine').hide() vim.cmd('Limelight') - vim.cmd('VimRToggleFullscreen') + if vim.fn.exists('g:gui_vimr') == 1 then + vim.cmd('VimRToggleFullscreen') + end end local goyo_leave = function() @@ -36,10 +34,12 @@ return { vim.opt.showmode = true vim.opt.showcmd = true vim.opt.scrolloff = 5 - dofile(script_path() .. '../config/galaxyline.lua') + require('lualine').hide({ unhide = true }) vim.opt.laststatus = 3 vim.cmd('Limelight!') - vim.cmd('VimRToggleFullscreen') + if vim.fn.exists('g:gui_vimr') == 1 then + vim.cmd('VimRToggleFullscreen') + end end local goyo_augroup = vim.api.nvim_create_augroup('Goyo', { clear = true }) diff --git a/neovim/.config/nvim/lua/plugins/lspsaga.lua b/neovim/.config/nvim/lua/plugins/lspsaga.lua index 53bff94..27173ec 100644 --- a/neovim/.config/nvim/lua/plugins/lspsaga.lua +++ b/neovim/.config/nvim/lua/plugins/lspsaga.lua @@ -11,7 +11,11 @@ return { }, lightbulb = { virtual_text = false, - } + }, + diagnostic = { + diagnostic_only_current = true, + border_follow = false, + }, }, keys = { { "gh", "<cmd>Lspsaga finder<CR>", desc = "Lspsaga finder" }, diff --git a/neovim/.config/nvim/lua/plugins/galaxyline.lua b/neovim/.config/nvim/lua/plugins/lualine.lua index d3f8ba7..f1647b2 100644 --- a/neovim/.config/nvim/lua/plugins/galaxyline.lua +++ b/neovim/.config/nvim/lua/plugins/lualine.lua @@ -1,13 +1,12 @@ return { { - 'nvimdev/galaxyline.nvim', - branch = 'main', + 'nvim-lualine/lualine.nvim', dependencies = { { 'nvim-tree/nvim-web-devicons', }, { - "catppuccin/nvim", + 'catppuccin/nvim', name = "catppuccin", priority = 1000, lazy = false, @@ -16,6 +15,11 @@ return { }, }, { + 'neanias/everforest-nvim', + priority = 1000, + lazy = false, + }, + { 'navarasu/onedark.nvim', lazy = false, priority = 1000, @@ -66,7 +70,7 @@ return { }, event = { 'BufEnter', 'VimEnter' }, config = function() - require('config.galaxyline') + require('config.lualine') end, - }, + } } diff --git a/neovim/.config/nvim/lua/plugins/neogit.lua b/neovim/.config/nvim/lua/plugins/neogit.lua index a0a3f90..43dcf02 100644 --- a/neovim/.config/nvim/lua/plugins/neogit.lua +++ b/neovim/.config/nvim/lua/plugins/neogit.lua @@ -7,11 +7,8 @@ return { 'sindrets/diffview.nvim', }, opts = { - disable_commit_confirmation = true, - auto_refresh = true, - kind = 'tab', commit_editor = { - kind = 'auto', + staged_diff_split_kind = "auto", }, integrations = { -- Neogit only provides inline diffs. If you want a more traditional way to look at diffs, you can use `sindrets/diffview.nvim`. @@ -26,7 +23,8 @@ return { -- } -- } -- - diffview = true + diffview = true, + telescope = true, } }, keys = { diff --git a/neovim/.config/nvim/lua/plugins/noice.lua b/neovim/.config/nvim/lua/plugins/noice.lua new file mode 100644 index 0000000..004b868 --- /dev/null +++ b/neovim/.config/nvim/lua/plugins/noice.lua @@ -0,0 +1,94 @@ +return { + { + 'folke/noice.nvim', + event = 'VeryLazy', + opts = { + lsp = { + -- override markdown rendering so that **cmp** and other plugins use **Treesitter** + override = { + ['vim.lsp.util.convert_input_to_markdown_lines'] = true, + ['vim.lsp.util.stylize_markdown'] = true, + ['cmp.entry.get_documentation'] = true, -- requires hrsh7th/nvim-cmp + }, + progress = { + enabled = false, + }, + }, + -- you can enable a preset for easier configuration + presets = { + bottom_search = true, -- use a classic bottom cmdline for search + command_palette = true, -- position the cmdline and popupmenu together + long_message_to_split = true, -- long messages will be sent to a split + inc_rename = false, -- enables an input dialog for inc-rename.nvim + lsp_doc_border = false, -- add a border to hover docs and signature help + }, + popupmenu = { + enabled = true, + backend = "cmp", + }, + views = { + cmdline_popup = { + position = { + row = 5, + col = '50%', + }, + size = { + width = 60, + height = 'auto', + }, + }, + popupmenu = { + relative = 'editor', + position = { + row = 8, + col = '50%', + }, + size = { + width = 60, + height = 10, + }, + border = { + style = 'rounded', + padding = { 0, 1 }, + }, + win_options = { + winhighlight = { Normal = 'Normal', FloatBorder = 'DiagnosticInfo' }, + }, + }, + }, + routes = { + { + filter = { + event = 'lsp', + kind = 'progress', + cond = function(message) + local client = vim.tbl_get(message.opts, 'progress', 'client') + return client == 'null-ls' + end, + }, + opts = { + skip = true, + }, + }, + { + filter = { + event = 'msg_show', + kind = '', + find = 'written', + }, + opts = { + skip = true, + }, + }, + }, + }, + dependencies = { + -- if you lazy-load any plugin below, make sure to add proper `module='...'` entries + 'MunifTanjim/nui.nvim', + -- OPTIONAL: + -- `nvim-notify` is only needed, if you want to use the notification view. + -- If not available, we use `mini` as the fallback + 'rcarriga/nvim-notify', + }, + }, +} diff --git a/neovim/.config/nvim/lua/plugins/nvim_cmp.lua b/neovim/.config/nvim/lua/plugins/nvim_cmp.lua index f0a4f95..320b684 100644 --- a/neovim/.config/nvim/lua/plugins/nvim_cmp.lua +++ b/neovim/.config/nvim/lua/plugins/nvim_cmp.lua @@ -40,6 +40,17 @@ return { local cmp = require('cmp') local lspkind = require('lspkind') cmp.setup({ + enabled = function() + -- disable completion in comments + local context = require 'cmp.config.context' + -- keep command mode completion enabled when cursor is in a comment + if vim.api.nvim_get_mode().mode == 'c' then + return true + else + return not context.in_treesitter_capture("comment") + and not context.in_syntax_group("Comment") + end + end, snippet = { -- REQUIRED - you must specify a snippet engine expand = function(args) @@ -91,7 +102,12 @@ return { sources = cmp.config.sources({ { name = 'path' } }, { - { name = 'cmdline' } + { + name = 'cmdline', + option = { + ignore_cmds = { 'Man', '!' }, + }, + }, }) }) end, diff --git a/neovim/.config/nvim/lua/plugins/nvim_lspconfig.lua b/neovim/.config/nvim/lua/plugins/nvim_lspconfig.lua index 48a86c6..fbae976 100644 --- a/neovim/.config/nvim/lua/plugins/nvim_lspconfig.lua +++ b/neovim/.config/nvim/lua/plugins/nvim_lspconfig.lua @@ -1,15 +1,21 @@ return { { + dependencies = { + { 'williamboman/mason.nvim' }, + { 'williamboman/mason-lspconfig.nvim' }, + }, 'neovim/nvim-lspconfig', lazy = false, priority = 800, config = function() + require("mason").setup() + require("mason-lspconfig").setup() local nvim_lsp = require('lspconfig') local capabilities = require('cmp_nvim_lsp').default_capabilities() -- Use a loop to conveniently call 'setup' on multiple servers and -- map buffer local keybindings when the language server attaches local servers = { "bashls", "clangd", "cssls", "dockerls", "gopls", "htmx", "jsonls", "marksman", - "phpactor", "psalm", "ruff", "rust_analyzer", "taplo", "yamlls" } + "ruff", "rust_analyzer", "taplo", "ts_ls", "yamlls" } for _, lsp in ipairs(servers) do nvim_lsp[lsp].setup { capabilities = capabilities, @@ -19,6 +25,25 @@ return { } end + require 'lspconfig'.basedpyright.setup { + settings = { + basedpyright = { + -- Using Ruff's import organizer + disableOrganizeImports = true, + }, + python = { + analysis = { + -- Ignore all files for analysis to exclusively use Ruff for linting + ignore = { '*' }, + }, + }, + }, + capabilities = capabilities, + flags = { + debounce_text_changes = 150, + }, + } + require 'lspconfig'.lua_ls.setup { on_init = function(client) local path = client.workspace_folders[1].name @@ -69,48 +94,14 @@ return { }, } - require 'lspconfig'.ts_ls.setup { - filetypes = { 'typescript', 'typescriptreact', 'typescript.tsx' }, + require 'lspconfig'.intelephense.setup { + filetypes = { 'php' }, capabilities = capabilities, flags = { debounce_text_changes = 150, }, - } - - require 'lspconfig'.pylsp.setup { - settings = { - pylsp = { - plugins = { - autopep8 = { - enabled = false, - }, - black = { - enabled = false, - }, - mccabe = { - enabled = false, - }, - pycodestyle = { - enabled = false, - }, - pyflakes = { - enabled = false, - }, - pylsp_mypy = { - enabled = true, - }, - ruff = { - enabled = false, - }, - yapf = { - enabled = false, - }, - } - } - }, - capabilities = capabilities, - flags = { - debounce_text_changes = 150, + init_options = { + licenceKey = '~/.config/intelephense/licence.txt', }, } @@ -145,6 +136,15 @@ return { end, desc = 'LSP: Disable hover capability from Ruff', }) + + -- Disable diagnostics for gen.nvim + vim.api.nvim_create_autocmd({ "LspAttach" }, { + group = vim.api.nvim_create_augroup("lsp_disable", { clear = true }), + pattern = 'gen.nvim', + callback = function(args) + vim.diagnostic.enable(false, { bufnr = args.buf }) + end, + }) end, }, } diff --git a/neovim/.config/nvim/lua/plugins/tabby.lua b/neovim/.config/nvim/lua/plugins/tabby.lua index 0aa271e..b51c859 100644 --- a/neovim/.config/nvim/lua/plugins/tabby.lua +++ b/neovim/.config/nvim/lua/plugins/tabby.lua @@ -4,6 +4,7 @@ return { dependencies = { 'nvim-tree/nvim-web-devicons', }, + cond = function() return vim.fn.has('gui_running') == 0 end, config = function() local theme = { fill = 'TabLineFill', diff --git a/neovim/.config/nvim/lua/plugins/telescope.lua b/neovim/.config/nvim/lua/plugins/telescope.lua index 6a81359..08729ca 100644 --- a/neovim/.config/nvim/lua/plugins/telescope.lua +++ b/neovim/.config/nvim/lua/plugins/telescope.lua @@ -1,13 +1,52 @@ return { { 'nvim-telescope/telescope.nvim', + tag = '0.1.8', dependencies = { - 'nvim-lua/plenary.nvim', + { + 'nvim-lua/plenary.nvim', + }, + { + "nvim-telescope/telescope-live-grep-args.nvim", + -- This will not install any breaking changes. + -- For major updates, this must be adjusted manually. + version = "^1.0.0", + }, }, + cmd = "Telescope", keys = { - { '<F3>', '<cmd>Telescope buffers<CR>', desc = 'Telescope buffers' }, + { '<F3>', '<cmd>Telescope buffers<CR>', desc = 'Telescope buffers' }, { '<F4>', '<cmd>Telescope find_files<CR>', desc = 'Telescope find files' }, - { '<F6>', '<cmd>Telescope live_grep<CR>', desc = 'Telescope live grep' }, + { '<F6>', '<cmd>Telescope live_grep<CR>', desc = 'Telescope live grep' }, }, + config = function() + local telescope = require("telescope") + local lga_actions = require("telescope-live-grep-args.actions") + + -- first setup telescope + telescope.setup({ + extensions = { + live_grep_args = { + auto_quoting = true, -- enable/disable auto-quoting + -- define mappings, e.g. + mappings = { -- extend mappings + i = { + ["<C-k>"] = lga_actions.quote_prompt(), + ["<C-i>"] = lga_actions.quote_prompt({ postfix = " --iglob " }), + -- freeze the current list and start a fuzzy search in the frozen list + ["<C-space>"] = lga_actions.to_fuzzy_refine, + }, + }, + -- ... also accepts theme settings, for example: + -- theme = "dropdown", -- use dropdown theme + -- theme = { }, -- use own theme spec + -- layout_config = { mirror=true }, -- mirror preview pane + } + } + }) + + -- then load the extension + telescope.load_extension("live_grep_args") + end }, } diff --git a/neovim/.config/nvim/lua/plugins/vim_svelte_plugin.lua b/neovim/.config/nvim/lua/plugins/vim_svelte_plugin.lua new file mode 100644 index 0000000..edcf7b6 --- /dev/null +++ b/neovim/.config/nvim/lua/plugins/vim_svelte_plugin.lua @@ -0,0 +1,6 @@ +return { + { + 'leafOfTree/vim-svelte-plugin', + ft = 'svelte', + } +} diff --git a/neovim/.config/nvim/lua/settings.lua b/neovim/.config/nvim/lua/settings.lua index 4d3c601..590164d 100644 --- a/neovim/.config/nvim/lua/settings.lua +++ b/neovim/.config/nvim/lua/settings.lua @@ -1,7 +1,7 @@ -- General settings vim.g.loaded_python_provider = 1 -vim.g.python3_host_prog = '/Users/michael/.pyenv/shims/python3' +vim.g.python3_host_prog = '/opt/homebrew/bin/python3' vim.g.loaded_perl_provider = 0 vim.g.loaded_ruby_provider = 0 @@ -25,7 +25,7 @@ vim.opt.linebreak = true vim.opt.showbreak = '↪ ' vim.opt.breakindent = true vim.opt.termguicolors = true -vim.cmd[[ +vim.cmd [[ syntax on filetype on filetype plugin on @@ -39,10 +39,29 @@ vim.opt.shortmess:append 'c' vim.opt.signcolumn = 'yes' vim.opt.laststatus = 3 +if vim.g.neovide then + vim.g.neovide_input_macos_option_key_is_meta = 'only_left' +end + +if vim.g.neovide then + vim.keymap.set('n', '<D-s>', ':w<CR>') -- Save + vim.keymap.set('v', '<D-c>', '"+y') -- Copy + vim.keymap.set('n', '<D-v>', '"+P') -- Paste normal mode + vim.keymap.set('v', '<D-v>', '"+P') -- Paste visual mode + vim.keymap.set('c', '<D-v>', '<C-R>+') -- Paste command mode + vim.keymap.set('i', '<D-v>', '<ESC>l"+Pli') -- Paste insert mode +end + +-- Allow clipboard copy paste in neovim +vim.api.nvim_set_keymap('', '<D-v>', '+p<CR>', { noremap = true, silent = true }) +vim.api.nvim_set_keymap('!', '<D-v>', '<C-R>+', { noremap = true, silent = true }) +vim.api.nvim_set_keymap('t', '<D-v>', '<C-R>+', { noremap = true, silent = true }) +vim.api.nvim_set_keymap('v', '<D-v>', '<C-R>+', { noremap = true, silent = true }) + -- Autocommands local indent_rules_augroup = vim.api.nvim_create_augroup('Indents', {}) -vim.api.nvim_create_autocmd( { 'FileType' }, { +vim.api.nvim_create_autocmd({ 'FileType' }, { pattern = { 'make', 'sh', 'zsh' }, group = indent_rules_augroup, callback = function() @@ -52,7 +71,7 @@ vim.api.nvim_create_autocmd( { 'FileType' }, { vim.opt_local.expandtab = false end }) -vim.api.nvim_create_autocmd( { 'FileType' }, { +vim.api.nvim_create_autocmd({ 'FileType' }, { pattern = { 'go' }, group = indent_rules_augroup, callback = function() @@ -62,7 +81,7 @@ vim.api.nvim_create_autocmd( { 'FileType' }, { vim.opt_local.expandtab = false end }) -vim.api.nvim_create_autocmd( { 'FileType' }, { +vim.api.nvim_create_autocmd({ 'FileType' }, { pattern = { 'javascript', 'lua' }, group = indent_rules_augroup, callback = function() @@ -73,7 +92,7 @@ vim.api.nvim_create_autocmd( { 'FileType' }, { }) local wrap_rules_augroup = vim.api.nvim_create_augroup('Wrap', {}) -vim.api.nvim_create_autocmd( { 'FileType' }, { +vim.api.nvim_create_autocmd({ 'FileType' }, { pattern = { 'markdown', 'rst', 'text' }, group = wrap_rules_augroup, callback = function() @@ -82,7 +101,7 @@ vim.api.nvim_create_autocmd( { 'FileType' }, { }) local terminal_rules_augroup = vim.api.nvim_create_augroup('Terminal', {}) -vim.api.nvim_create_autocmd( { 'TermOpen' }, { +vim.api.nvim_create_autocmd({ 'TermOpen' }, { pattern = { '*' }, group = terminal_rules_augroup, callback = function() @@ -98,7 +117,7 @@ vim.api.nvim_create_autocmd( { 'TermOpen' }, { }) -- Terminal -vim.cmd[[ +vim.cmd [[ tnoremap <Esc> <C-\><C-n> tnoremap <A-h> <C-\><C-N><C-w>h tnoremap <A-j> <C-\><C-N><C-w>j @@ -144,4 +163,15 @@ if vim.fn.has('gui_running') == 1 then vim.keymap.set('n', '<S-D-}>', '<cmd>tabn<CR>', { noremap = true, silent = true }) vim.keymap.set('v', '<S-D-}>', '<cmd>tabn<CR>', { noremap = true, silent = true }) vim.keymap.set('i', '<S-D-}>', '<Esc><cmd>tabn<CR>', { noremap = true, silent = true }) + vim.keymap.set('n', '<M-S-{>', '<cmd>tabp<CR>', { noremap = true, silent = true }) + vim.keymap.set('v', '<M-S-{>', '<cmd>tabp<CR>', { noremap = true, silent = true }) + vim.keymap.set('i', '<M-S-{>', '<Esc><cmd>tabp<CR>', { noremap = true, silent = true }) + vim.keymap.set('n', '<M-S-}>', '<cmd>tabn<CR>', { noremap = true, silent = true }) + vim.keymap.set('v', '<M-S-}>', '<cmd>tabn<CR>', { noremap = true, silent = true }) + vim.keymap.set('i', '<M-S-}>', '<Esc><cmd>tabn<CR>', { noremap = true, silent = true }) end + +vim.diagnostic.config({ + underline = { severity = vim.diagnostic.severity.ERROR }, + virtual_text = false, +}) |