From 35f91760b6b5ef2bc7b489359a89848c7ad44824 Mon Sep 17 00:00:00 2001 From: Alex Selimov Date: Wed, 14 Aug 2024 10:52:20 -0400 Subject: [PATCH] Latest config changes --- ftplugin/fortran.vim | 13 ------------ ftplugin/java.vim | 1 + ftplugin/markdown.vim | 3 +++ init.lua | 47 ++++++++++++++++++++++++++++++++++++++----- 4 files changed, 46 insertions(+), 18 deletions(-) delete mode 100644 ftplugin/fortran.vim create mode 100644 ftplugin/java.vim diff --git a/ftplugin/fortran.vim b/ftplugin/fortran.vim deleted file mode 100644 index f58620c..0000000 --- a/ftplugin/fortran.vim +++ /dev/null @@ -1,13 +0,0 @@ -map : w % ! make - -"Some code snippets for filling in -inoremap ;d doenddoO<++>kA -inoremap ;i if()thenendifO<++>kF(a -inoremap ;s selectcase(<++>)case(<++>)<++>4hicase(<++>)<++>4hiendselect5kFsi -inoremap ;ph print *, '------------------------------------------------------------'print *, ''print *, '------------------------------------------------------------'kci' -inoremap ;pr read(, *, iostat=iospara) <++>if(iospara>0) thenprint *, "Error: Invalid read of <++> with error code", iosparacall mpi_abort(mpi_comm_world, 1, ierr)end if4k0f(a -inoremap ;ptp print *, '[OK] - 'i -inoremap ;ptf print *, '[FAILED] - 'i - - -set colorcolumn=132 diff --git a/ftplugin/java.vim b/ftplugin/java.vim new file mode 100644 index 0000000..95c752b --- /dev/null +++ b/ftplugin/java.vim @@ -0,0 +1 @@ +set tw=120 diff --git a/ftplugin/markdown.vim b/ftplugin/markdown.vim index cd4ba64..56631db 100644 --- a/ftplugin/markdown.vim +++ b/ftplugin/markdown.vim @@ -11,6 +11,9 @@ map : w % AsyncRun md2pdf "%" map : w % AsyncRun md2beamer "%" map : w % AsyncRun md2docx % map : !zathura %:r.pdf & +inoremap ;b ****hi +command Stab Tabularize /\s\+\zs\s/l1c0 +nnoremap ;t :Tabularize /\s\+\zs\s/l1c0 set tw=1000 set colorcolumn= diff --git a/init.lua b/init.lua index 26940bd..694cea1 100644 --- a/init.lua +++ b/init.lua @@ -213,6 +213,14 @@ require("lazy").setup({ }, "godlygeek/tabular", "tpope/vim-sleuth", + { + "codersauce/runst.nvim", + lazy = false, + opts = {}, + config = function() + require("runst").setup() + end, + }, { "Vigemus/iron.nvim", ft = { "python" }, @@ -328,6 +336,9 @@ require("lazy").setup({ }, { -- LSP Configuration & Plugins "neovim/nvim-lspconfig", + opts = { + autoformat = false, + }, dependencies = { -- Automatically install LSPs and related tools to stdpath for neovim "williamboman/mason.nvim", @@ -435,6 +446,7 @@ require("lazy").setup({ "cpp", }, }, + yamlls = {}, -- gopls = {}, jdtls = { filetypes = { "java" }, @@ -453,8 +465,13 @@ require("lazy").setup({ bashls = { dependencies = "shellcheck" }, rust_analyzer = { settings = { - files = { - excludeDirs = { "$HOME", "$HOME/.cargo/**", "$HOME/.rustup/**" }, + ["rust-analyzer"] = { + check = { + command = "clippy", + }, + rustfmt = { + extraArgs = { "+nightly" }, + }, }, }, }, @@ -539,6 +556,7 @@ require("lazy").setup({ "ormolu", "beautysh", "latexindent", + "prettier", }) require("mason-tool-installer").setup({ ensure_installed = ensure_installed }) @@ -548,6 +566,9 @@ require("lazy").setup({ local server = servers[server_name] or {} require("lspconfig")[server_name].setup({ cmd = server.cmd, + on_init = function(client) + client.offset_encoding = "utf-8" + end, settings = server.settings, filetypes = server.filetypes, -- This handles overriding only values explicitly passed @@ -575,17 +596,17 @@ require("lazy").setup({ notify_on_error = false, format_on_save = { timeout_ms = 500, - lsp_fallback = true, + lsp_fallback = false, }, formatters_by_ft = { lua = { "stylua" }, -- Conform can also run multiple formatters sequentially python = { "black" }, - rust = { "rustfmt" }, cpp = { "clang-format" }, c = { "clang-format" }, sh = { "beautysh" }, tex = { "latexindent" }, + yaml = { "prettier" }, }, }, }, @@ -648,6 +669,19 @@ require("lazy").setup({ text({ "", "}\\\\", "" }), }), }, + markdown = { + snip({ + trig = "img", + namr = "image", + dscr = "Markdown img", + }, { + text({ "![" }), + insert(1), + text("]("), + insert(2), + text(")"), + }), + }, }) end, }, @@ -775,7 +809,7 @@ require("lazy").setup({ -- Autoinstall languages that are not installed auto_install = true, highlight = { enable = false }, - indent = { enable = true }, + indent = { enable = false }, }) -- There are additional nvim-treesitter modules that you can use to interact @@ -786,7 +820,10 @@ require("lazy").setup({ -- - Treesitter + textobjects: https://github.com/nvim-treesitter/nvim-treesitter-textobjects end, }, + "airblade/vim-gitgutter", }) +--Set rustfmt command +vim.g["rustfmt_command"] = "rustfmt +nightly" --Disable semantic highlights for _, group in ipairs(vim.fn.getcompletion("@lsp", "highlight")) do vim.api.nvim_set_hl(0, group, {})