From 7d27760751e296418fe3528355dc5e97a0264ea9 Mon Sep 17 00:00:00 2001 From: TiagoRG Date: Sat, 22 Jun 2024 19:40:50 +0100 Subject: [PATCH] Neovim changes Signed-off-by: TiagoRG --- .config/nvim/after/plugin/autoclose.lua | 6 +++--- .config/nvim/after/plugin/lualine.lua | 2 +- .config/nvim/after/plugin/trouble.lua | 2 +- .config/nvim/after/plugin/wrapping.lua | 6 +++--- .config/nvim/lua/tiagorg/autocmd.lua | 14 +++++++------- .config/nvim/lua/tiagorg/packer.lua | 18 ------------------ .config/nvim/lua/tiagorg/set.lua | 3 +-- 7 files changed, 16 insertions(+), 35 deletions(-) diff --git a/.config/nvim/after/plugin/autoclose.lua b/.config/nvim/after/plugin/autoclose.lua index ac6e4c7..9e66d01 100644 --- a/.config/nvim/after/plugin/autoclose.lua +++ b/.config/nvim/after/plugin/autoclose.lua @@ -9,9 +9,9 @@ require("autoclose").setup({ ["]"] = { escape = true, close = false, pair = "[]", disabled_filetypes = {} }, ["}"] = { escape = true, close = false, pair = "{}", disabled_filetypes = {} }, - ['"'] = { escape = true, close = true, pair = '""', disabled_filetypes = {"gitcommit", "tex"} }, - ["'"] = { escape = true, close = true, pair = "''", disabled_filetypes = {"gitcommit", "tex"} }, - ["`"] = { escape = true, close = true, pair = "``", disabled_filetypes = {"gitcommit", "tex"} }, + ['"'] = { escape = true, close = true, pair = '""', disabled_filetypes = {"gitcommit", "tex", "asciidoc"} }, + ["'"] = { escape = true, close = true, pair = "''", disabled_filetypes = {"gitcommit", "tex", "asciidoc"} }, + ["`"] = { escape = true, close = true, pair = "``", disabled_filetypes = {"gitcommit", "tex", "asciidoc"} }, ["$"] = { escape = true, close = true, pair = "$$", enabled_filetypes = {"tex"} }, }, diff --git a/.config/nvim/after/plugin/lualine.lua b/.config/nvim/after/plugin/lualine.lua index 7b0315e..bde3297 100644 --- a/.config/nvim/after/plugin/lualine.lua +++ b/.config/nvim/after/plugin/lualine.lua @@ -10,7 +10,7 @@ require('lualine').setup { }, ignore_focus = {}, always_divide_middle = true, - globalstatus = false, + globalstatus = true, refresh = { statusline = 10, tabline = 1000, diff --git a/.config/nvim/after/plugin/trouble.lua b/.config/nvim/after/plugin/trouble.lua index a70883f..ab36824 100644 --- a/.config/nvim/after/plugin/trouble.lua +++ b/.config/nvim/after/plugin/trouble.lua @@ -1,7 +1,7 @@ require("trouble").setup { position = "bottom", auto_open = true, - auto_close = true, + auto_close = false, auto_preview = false, icons = true, } diff --git a/.config/nvim/after/plugin/wrapping.lua b/.config/nvim/after/plugin/wrapping.lua index da1bad4..ab46d7f 100644 --- a/.config/nvim/after/plugin/wrapping.lua +++ b/.config/nvim/after/plugin/wrapping.lua @@ -1,6 +1,4 @@ -require("wrapping").setup() - -opts = { +local opts = { auto_set_mode_filetype_allowlist = { "asciidoc", "gitcommit", @@ -14,3 +12,5 @@ opts = { }, soft_wrap = true, } + +require("wrapping").setup(opts) diff --git a/.config/nvim/lua/tiagorg/autocmd.lua b/.config/nvim/lua/tiagorg/autocmd.lua index 3977df1..7fd8007 100644 --- a/.config/nvim/lua/tiagorg/autocmd.lua +++ b/.config/nvim/lua/tiagorg/autocmd.lua @@ -7,13 +7,13 @@ vim.api.nvim_create_autocmd({ "BufWritePre" }, { end, }) -vim.api.nvim_exec([[ - augroup SearchHighlight - autocmd! - autocmd CmdlineLeave /,\? :nnoremap :noh - autocmd CmdlineChanged /,\? :nnoremap :noh - augroup END -]], false) +vim.api.nvim_create_autocmd({"CmdlineLeave", "CmdlineChanged"}, { + group = vim.api.nvim_create_augroup("SearchHighlight", { clear = true }), + pattern = { "/", "\\?" }, + callback = function() + vim.cmd([[nnoremap :noh]]) + end +}) vim.api.nvim_create_autocmd("TextYankPost", { desc = "Highlight yanked text", diff --git a/.config/nvim/lua/tiagorg/packer.lua b/.config/nvim/lua/tiagorg/packer.lua index 3185253..2195318 100644 --- a/.config/nvim/lua/tiagorg/packer.lua +++ b/.config/nvim/lua/tiagorg/packer.lua @@ -69,22 +69,4 @@ return require('packer').startup(function(use) -- Little friend use("github/copilot.vim") - - -- trying out - use { - 'windwp/nvim-ts-autotag', - config = function() - require('nvim-ts-autotag').setup() - -- require 'nvim-treesitter.configs'.setup { - -- autotag = { - -- enable = true, - -- enable_rename = true, - -- enable_close = true, - -- enable_close_on_slash = true, - -- filetypes = { "html", "xml", "javascript", "typescript", "svelte", "vue", "javascriptreact", "typescriptreact"}, - -- } - -- } - end - } - use 'mg979/vim-visual-multi' end) diff --git a/.config/nvim/lua/tiagorg/set.lua b/.config/nvim/lua/tiagorg/set.lua index 89c6e6f..d4bdc10 100644 --- a/.config/nvim/lua/tiagorg/set.lua +++ b/.config/nvim/lua/tiagorg/set.lua @@ -30,7 +30,6 @@ vim.opt.undofile = true vim.opt.termguicolors = true vim.opt.isfname:append("@-@") -vim.opt.guitablabel = "\\[%N\\]\\ %t\\ %M" -vim.g.copilot_node_command = "/usr/bin/nodenv" +vim.g.copilot_node_command = "node" vim.g.copilot_assume_mapped = true