Configure and fix syntax

This commit is contained in:
Steins7 2022-10-18 18:17:43 +02:00
parent cd2169b12e
commit c65ba7a9f6
5 changed files with 33 additions and 9 deletions

10
ftplugin/c.lua Normal file
View File

@ -0,0 +1,10 @@
vim.g.cino = "N-s"
vim.o.textwidth = 80
vim.g.cpp_attributes_highlight = true
vim.g.cpp_member_highlight = true
vim.g.cpp_simple_highlight = true
-- remove white spaces at end of line
vim.api.nvim_create_autocmd({'BufWritePre'}, {command = '%s;\\s\\+$;;e'})

5
ftplugin/lua.lua Normal file
View File

@ -0,0 +1,5 @@
vim.o.textwidth = 100
-- remove white spaces at end of line
vim.api.nvim_create_autocmd({'BufWritePre'}, {command = '%s;\\s\\+$;;e'})

5
ftplugin/rust.lua Normal file
View File

@ -0,0 +1,5 @@
vim.o.textwidth = 100
-- remove white spaces at end of line
vim.api.nvim_create_autocmd({'BufWritePre'}, {command = '%s;\\s\\+$;;e'})

View File

@ -1,10 +1,11 @@
-- Set global configuration -- Set global configuration
vim.g.mapleader = "," vim.g.mapleader = ","
vim.o.number = true vim.o.number = true
vim.o.colorcolumn = '+1'
-- Set indentation options -- Set indentation options
vim.o.tabstop = 4 vim.o.tabstop = 4
vim.o.shiftwidth = 4 vim.o.shiftwidth = 4
vim.o.expandtab = true vim.o.expandtab = true
-- Disable unused providers -- Disable unused providers

View File

@ -41,7 +41,7 @@ local function manage_plugins()
vim.cmd("colorscheme nightfox") vim.cmd("colorscheme nightfox")
end end
}, },
-- COQ -- COQ
["https://github.com/ms-jpq/coq_nvim.git"] = {}, ["https://github.com/ms-jpq/coq_nvim.git"] = {},
["https://github.com/ms-jpq/coq.artifacts.git"] = { ["https://github.com/ms-jpq/coq.artifacts.git"] = {
@ -60,10 +60,10 @@ local function manage_plugins()
server = { server = {
on_attach = function(_, bufnr) on_attach = function(_, bufnr)
-- Hover actions -- Hover actions
vim.keymap.set("n", "<C-space>", vim.keymap.set("n", "<C-space>",
rt.hover_actions.hover_actions, { buffer = bufnr }) rt.hover_actions.hover_actions, { buffer = bufnr })
-- Code action groups -- Code action groups
vim.keymap.set("n", "<Leader>a", vim.keymap.set("n", "<Leader>a",
rt.code_action_group.code_action_group, { buffer = bufnr }) rt.code_action_group.code_action_group, { buffer = bufnr })
end, end,
}, },
@ -80,24 +80,27 @@ local function manage_plugins()
vim.cmd('set signcolumn=number') vim.cmd('set signcolumn=number')
end end
}, },
-- Syntax highlight
["https://github.com/bfrg/vim-cpp-modern.git"] = {},
} }
local manager = require("plogins").manage(plugins) local manager = require("plogins").manage(plugins)
vim.api.nvim_create_user_command("PloginsUpgrade", vim.api.nvim_create_user_command("PloginsUpgrade",
manager.upgrade, {}) manager.upgrade, {})
vim.api.nvim_create_user_command("PloginsAutoremove", vim.api.nvim_create_user_command("PloginsAutoremove",
manager.autoremove, {}) manager.autoremove, {})
end end
local plogins_source = "https://github.com/faerryn/plogins.nvim.git" local plogins_source = "https://github.com/faerryn/plogins.nvim.git"
local plogins_name = plogins_source:gsub("/", "%%") local plogins_name = plogins_source:gsub("/", "%%")
local plogins_dir = ("%s/site/pack/plogins/opt/%s"):format((vim.fn.stdpath("data")), local plogins_dir = ("%s/site/pack/plogins/opt/%s"):format((vim.fn.stdpath("data")),
plogins_name) plogins_name)
if not vim.loop.fs_stat(plogins_dir) then if not vim.loop.fs_stat(plogins_dir) then
vim.loop.spawn("git", vim.loop.spawn("git",
{ args = { "clone", "--depth", "1", plogins_source, plogins_dir } }, { args = { "clone", "--depth", "1", plogins_source, plogins_dir } },
function(code, signal) function(code, signal)
vim.defer_fn(function() vim.defer_fn(function()
vim.cmd(("packadd %s"):format(vim.fn.fnameescape(plogins_name))) vim.cmd(("packadd %s"):format(vim.fn.fnameescape(plogins_name)))